summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Hatch <Jeff.Hatch@multitech.com>2018-04-16 08:26:26 -0500
committerJeff Hatch <Jeff.Hatch@multitech.com>2018-04-16 08:26:26 -0500
commitee1a8a554ea8a182bfdbbc5d04d4ca8814cde410 (patch)
treea1ef6ae53c4ee830bf81c2469126eaad1587f4e4
parentaaf0cae749d393ec18505a4cf28aaeb3dd8e12b0 (diff)
downloadradio-query-ee1a8a554ea8a182bfdbbc5d04d4ca8814cde410.tar.gz
radio-query-ee1a8a554ea8a182bfdbbc5d04d4ca8814cde410.tar.bz2
radio-query-ee1a8a554ea8a182bfdbbc5d04d4ca8814cde410.zip
Add --location arg processing for radio-query --location command0.5
-rw-r--r--main.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index 12b5d81..1ea2e7b 100644
--- a/main.cpp
+++ b/main.cpp
@@ -81,6 +81,7 @@ const uint32_t OPT_TYPE = 0x00001000;
const uint32_t OPT_CARRIER = 0x00002000;
const uint32_t OPT_DATETIME = 0x00004000;
const uint32_t OPT_ACTIVEFIRMWARE = 0x00008000;
+const uint32_t OPT_LOCATION = 0x00010000;
const uint32_t OPT_SUMMARY_STATIC = 0x01000000;
const uint32_t OPT_SUMMARY_NETWORK = 0x02000000;
@@ -148,7 +149,6 @@ int main(int argc, char** argv) {
}
CellularRadio::CODE result = CellularRadio::CODE::SUCCESS;
-
if(g_iOptions & OPT_SUMMARY_NETWORK) {
printf("%s", getNetworkData().toStyledString().c_str());
} else if(g_iOptions & OPT_SUMMARY_STATIC) {
@@ -160,7 +160,15 @@ int main(int argc, char** argv) {
writeToCache(FRSSI, iValue);
printf("%d", iValue);
}
- } else if(g_iOptions & OPT_NETREG) {
+ }else if(g_iOptions & OPT_LOCATION) {
+ std::string sValue;
+ result = g_apRadio->getModemLocation(sValue);
+ if(result == CellularRadio::SUCCESS) {
+ printf("%s", sValue.c_str());
+ } else {
+ printf("Radio has not location support");
+ }
+ }else if(g_iOptions & OPT_NETREG) {
std::string sValue;
CellularRadio::REGISTRATION eReg;
result = g_apRadio->getRegistration(eReg);
@@ -492,6 +500,7 @@ void parseOptions(int argc, char** argv) {
{ "phonenumber", no_argument, &iOption, OPT_PHONENUMBER },
{ "mdn", no_argument, &iOption, OPT_MDN },
{ "rssi", no_argument, &iOption, OPT_RSSI },
+ { "location", no_argument, &iOption, OPT_LOCATION },
{ "tower", no_argument, &iOption, OPT_TOWER },
{ "iccid", no_argument, &iOption, OPT_ICCID },
{ "service", no_argument, &iOption, OPT_SERVICE },
@@ -597,6 +606,7 @@ void printHelp(const std::string& sApp) {
printf("\t--phonenumber\n");
printf("\t--mdn\n");
printf("\t--rssi\n");
+ printf("\t--location\n");
printf("\t--tower\n");
printf("\t--iccid\n");
printf("\t--service\n");