summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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");