summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Hatch <jhatch@multitech.com>2019-12-06 12:54:03 -0600
committerJeff Hatch <jhatch@multitech.com>2019-12-06 12:54:03 -0600
commita6d4914dbf938fbf48c6ace4280f97864c1b4866 (patch)
tree8fb7a9cd02822c76f2b577718fcca69e1d002541
parent7152de5483b6257f87a7ead5c29e4e768a4bab39 (diff)
parent22485f557fe57459ef2822e39a41d9c6a0c49b47 (diff)
downloadradio-query-a6d4914dbf938fbf48c6ace4280f97864c1b4866.tar.gz
radio-query-a6d4914dbf938fbf48c6ace4280f97864c1b4866.tar.bz2
radio-query-a6d4914dbf938fbf48c6ace4280f97864c1b4866.zip
Merge branch 'radio_code_option' into 'master' 0.9
Added support for the "radio-query --code" option See merge request !3
-rw-r--r--main.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 7617c4a..fdb7cd8 100644
--- a/main.cpp
+++ b/main.cpp
@@ -86,6 +86,7 @@ const uint32_t OPT_ACTIVEFIRMWARE = 0x00008000;
const uint32_t OPT_LOCATION = 0x00010000;
const uint32_t OPT_FIRMWAREBUILD = 0x00020000;
const uint32_t OPT_SIM_STATUS = 0x00040000;
+const uint32_t OPT_RADIO_CODE = 0x00080000;
const uint32_t OPT_SUMMARY_STATIC = 0x01000000;
const uint32_t OPT_SUMMARY_NETWORK = 0x02000000;
@@ -261,6 +262,16 @@ int main(int argc, char** argv) {
if(result == ICellularRadio::SUCCESS) {
printf("%s", sValue.c_str());
}
+ } else if(g_iOptions & OPT_RADIO_CODE) {
+ std::string sValue;
+ std::string sCode;
+ result = g_apRadio->getModel(sValue);
+ if(result == ICellularRadio::SUCCESS) {
+ result = g_apRadio->convertModelToMtsShortCode(g_sModel, sCode, g_apRadio.get());
+ if(result == ICellularRadio::SUCCESS) {
+ printf("%s", sCode.c_str());
+ }
+ }
} else if(g_iOptions & OPT_TYPE) {
std::string sValue;
std::string sType;
@@ -552,6 +563,7 @@ void parseOptions(int argc, char** argv) {
{ "datetime", no_argument, &iOption, OPT_DATETIME },
{ "active-firmware", no_argument, &iOption, OPT_ACTIVEFIRMWARE },
{ "sim-status", no_argument, &iOption, OPT_SIM_STATUS },
+ { "code", no_argument, &iOption, OPT_RADIO_CODE },
{ "static", no_argument, &iOption, OPT_SUMMARY_STATIC },
{ "dynamic", no_argument, &iOption, OPT_SUMMARY_NETWORK },
{ "cellular-mode",no_argument, &iOption, OPT_CELL_MODE },
@@ -648,6 +660,7 @@ void printHelp(const std::string& sApp) {
printf("\t--imsi\n");
printf("\t--lac\n");
printf("\t--model\n");
+ printf("\t--code\n");
printf("\t--netreg\n");
printf("\t--network\n");
printf("\t--phonenumber\n");