From 5f7e999597ef8297fa4a82a71dda38dff3cd68fa Mon Sep 17 00:00:00 2001 From: Maksym Telychko Date: Mon, 10 Jun 2019 11:59:57 +0300 Subject: [MTS-MTQ] refactoring: switched to ICellularRadio --- main.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/main.cpp b/main.cpp index a5eeb97..b74c9c6 100644 --- a/main.cpp +++ b/main.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -67,7 +67,7 @@ std::string g_sActiveFirmware; std::string g_sConfigFile; Json::Value g_jData; -MTS::AutoPtr g_apRadio; +MTS::AutoPtr g_apRadio; int32_t g_iOptions = 0; @@ -108,7 +108,7 @@ void printHelp(const std::string& sApp); void parseOptions(int argc, char** argv); void initializeCache(); void shutdown(); -const char *code2str(MTS::IO::CellularRadio::CODE code); +const char *code2str(MTS::IO::ICellularRadio::CODE code); std::string loadImeiFromDeviceInfo(); @@ -147,7 +147,7 @@ std::string loadImeiFromDeviceInfo(); Json::Value getStaticData(); Json::Value getNetworkData(); -MTS::IO::CellularRadio::UpdateCb cb = [](const Json::Value& s)->void { +MTS::IO::ICellularRadio::UpdateCb cb = [](const Json::Value& s)->void { if(s.isString()) { printf("%s\n", s.asCString()); } @@ -199,7 +199,7 @@ int main(int argc, char** argv) { return EXIT_FAILURE; } - CellularRadio::CODE result = CellularRadio::CODE::SUCCESS; + ICellularRadio::CODE result = ICellularRadio::CODE::SUCCESS; if(g_iOptions & OPT_COMMAND) { int32_t timeoutMillis = DEFAULT_TIMEOUT; @@ -211,7 +211,7 @@ int main(int argc, char** argv) { } } printDebug("AT Command: %s\n", g_sAtCommand.c_str()); - std::string sResult = g_apRadio->sendCommand(g_sAtCommand, MTS::IO::CellularRadio::DEFAULT_BAIL_STRINGS, timeoutMillis); + std::string sResult = g_apRadio->sendCommand(g_sAtCommand, MTS::IO::ICellularRadio::DEFAULT_BAIL_STRINGS, timeoutMillis); printDebug("RESULT: %s\n", sResult.c_str()); // skip first line std::size_t pos = sResult.find('\n'); @@ -305,7 +305,7 @@ int main(int argc, char** argv) { Json::Value jArgs(Json::objectValue); jArgs["msl"] = g_sMSL; result = g_apRadio->validateMsl(jArgs); - if(result == MTS::IO::CellularRadio::CODE::SUCCESS) { + if(result == MTS::IO::ICellularRadio::CODE::SUCCESS) { std::ofstream fMSL((g_sCache + "/" + FMSL).c_str(), std::ios_base::trunc | std::ios_base::out); if(fMSL.is_open()) { std::string sMSL; @@ -362,7 +362,7 @@ int main(int argc, char** argv) { shutdown(); - return (result == CellularRadio::CODE::SUCCESS) ? 0 : 1; + return (result == ICellularRadio::CODE::SUCCESS) ? 0 : 1; } void handle_sigterm(int signum) { @@ -627,19 +627,19 @@ void printHelp(const std::string& sApp) { printf("\t\tLE910, HE910, GE910, DE910, CE910\n"); } -const char *code2str(MTS::IO::CellularRadio::CODE code) { +const char *code2str(MTS::IO::ICellularRadio::CODE code) { switch (code) { - case MTS::IO::CellularRadio::CODE::SUCCESS: + case MTS::IO::ICellularRadio::CODE::SUCCESS: return "Success"; - case MTS::IO::CellularRadio::CODE::ERROR: + case MTS::IO::ICellularRadio::CODE::ERROR: return "Error"; - case MTS::IO::CellularRadio::CODE::FAILURE: + case MTS::IO::ICellularRadio::CODE::FAILURE: return "Failure"; - case MTS::IO::CellularRadio::CODE::NO_RESPONSE: + case MTS::IO::ICellularRadio::CODE::NO_RESPONSE: return "No Response"; - case MTS::IO::CellularRadio::CODE::NOT_APPLICABLE: + case MTS::IO::ICellularRadio::CODE::NOT_APPLICABLE: return "Not Applicable"; - case MTS::IO::CellularRadio::CODE::INVALID_ARGS: + case MTS::IO::ICellularRadio::CODE::INVALID_ARGS: return "Invalid Arguments"; } return "Unknown"; -- cgit v1.2.3 From 425d8bf72dd3d43896da1aa9374c137b69d89c0f Mon Sep 17 00:00:00 2001 From: Maksym Telychko Date: Sat, 22 Jun 2019 00:05:17 +0300 Subject: [MTS-MTQ] added set-radio-mode/get-radio-mode options --- main.cpp | 126 +++++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 83 insertions(+), 43 deletions(-) diff --git a/main.cpp b/main.cpp index b74c9c6..5a01aea 100644 --- a/main.cpp +++ b/main.cpp @@ -66,6 +66,7 @@ std::string g_sRxDiversity; std::string g_sActiveFirmware; std::string g_sConfigFile; Json::Value g_jData; +std::string g_sRadioMode; MTS::AutoPtr g_apRadio; @@ -102,6 +103,8 @@ const uint32_t OPT_MSID = 0x00800000; const uint32_t OPT_SETRXDIVERSITY = 0x01000000; const uint32_t OPT_SETACTIVEFIRMWARE = 0x02000000; const uint32_t OPT_CONFIG_FILE = 0x04000000; +const uint32_t OPT_GET_RADIOMODE = 0x08000000; +const uint32_t OPT_SET_RADIOMODE = 0x10000000; void handle_sigterm(int signum); void printHelp(const std::string& sApp); @@ -110,39 +113,44 @@ void initializeCache(); void shutdown(); const char *code2str(MTS::IO::ICellularRadio::CODE code); std::string loadImeiFromDeviceInfo(); - - - int iOption = 0; - static struct option long_options[] = - { { "help", no_argument, 0, '?' }, - { "version", no_argument, 0, 'v' }, - { "printlvl", required_argument, 0, 'p' }, - { "device", required_argument, 0, 'd' }, - { "config-file", required_argument, 0, 'c' }, - { "set-mdn", required_argument, 0, 'n' }, - { "set-msl", required_argument, 0, 'm' }, - { "set-msid", required_argument, 0, 's' }, - { "msl", required_argument, 0, 'l' }, - { "mdn", required_argument, 0, 'k' }, - { "msid", required_argument, 0, 'j' }, - { "set-active-firmware" , required_argument, 0, 'f' }, - { "set-rx-diversity", required_argument, 0, 'r' }, - { "set-mip-active-profile", required_argument, 0, '0' }, - { "set-mip-nai", required_argument, 0, '1' }, - { "set-mip-home-ip", required_argument, 0, '2' }, - { "set-mip-primary-ha", required_argument, 0, '3' }, - { "set-mip-secondary-ha", required_argument, 0, '4' }, - { "set-mip-mn-aaa-spi", required_argument, 0, '5' }, - { "set-mip-mn-ha-spi", required_argument, 0, '6' }, - { "set-mip-rev-tun", required_argument, 0, '7' }, - { "set-mip-mn-aaa-ss", required_argument, 0, '8' }, - { "set-mip-mn-ha-ss", required_argument, 0, '9' }, - { "init-dc", no_argument, &iOption, OPT_INIT_DC }, - { "init-fumo", no_argument, &iOption, OPT_INIT_FUMO }, - { "init-prl", no_argument, &iOption, OPT_INIT_PRL }, - { "init-activation", no_argument, &iOption, OPT_INIT_ACTIVATION }, - { "factory-default", no_argument, &iOption, OPT_INIT_RTN }, - { 0, 0, 0, 0 } }; +MTS::IO::ICellularRadio::RADIOMODE radioModeEnum(const std::string &mode); +const char* radioModeStr(MTS::IO::ICellularRadio::RADIOMODE mode); + + +static int iOption = 0; +static struct option long_options[] = { + { "help", no_argument, 0, '?' }, + { "version", no_argument, 0, 'v' }, + { "printlvl", required_argument, 0, 'p' }, + { "device", required_argument, 0, 'd' }, + { "config-file", required_argument, 0, 'c' }, + { "set-mdn", required_argument, 0, 'n' }, + { "set-msl", required_argument, 0, 'm' }, + { "set-msid", required_argument, 0, 's' }, + { "msl", required_argument, 0, 'l' }, + { "mdn", required_argument, 0, 'k' }, + { "msid", required_argument, 0, 'j' }, + { "set-active-firmware" , required_argument, 0, 'f' }, + { "set-rx-diversity", required_argument, 0, 'r' }, + { "set-mip-active-profile", required_argument, 0, '0' }, + { "set-mip-nai", required_argument, 0, '1' }, + { "set-mip-home-ip", required_argument, 0, '2' }, + { "set-mip-primary-ha", required_argument, 0, '3' }, + { "set-mip-secondary-ha", required_argument, 0, '4' }, + { "set-mip-mn-aaa-spi", required_argument, 0, '5' }, + { "set-mip-mn-ha-spi", required_argument, 0, '6' }, + { "set-mip-rev-tun", required_argument, 0, '7' }, + { "set-mip-mn-aaa-ss", required_argument, 0, '8' }, + { "set-mip-mn-ha-ss", required_argument, 0, '9' }, + { "get-radio-mode", no_argument, &iOption, OPT_GET_RADIOMODE }, + { "set-radio-mode", required_argument, 0, OPT_SET_RADIOMODE }, + { "init-dc", no_argument, &iOption, OPT_INIT_DC }, + { "init-fumo", no_argument, &iOption, OPT_INIT_FUMO }, + { "init-prl", no_argument, &iOption, OPT_INIT_PRL }, + { "init-activation", no_argument, &iOption, OPT_INIT_ACTIVATION }, + { "factory-default", no_argument, &iOption, OPT_INIT_RTN }, + { 0, 0, 0, 0 } +}; Json::Value getStaticData(); Json::Value getNetworkData(); @@ -358,6 +366,13 @@ int main(int argc, char** argv) { jArgs["fwid"] = g_sActiveFirmware; result = g_apRadio->setActiveFirmware(jArgs); printf("%s\n", code2str(result)); + } else if(g_iOptions & OPT_GET_RADIOMODE) { + ICellularRadio::RADIOMODE mode; + g_apRadio->getRadioMode(mode); + printf("%s\n", radioModeStr(mode)); + } else if(g_iOptions & OPT_SET_RADIOMODE) { + ICellularRadio::CODE res = g_apRadio->setRadioMode(radioModeEnum(g_sRadioMode)); + printf("%s\n", code2str(res)); } shutdown(); @@ -378,21 +393,15 @@ void shutdown() { } } -void parseOptions(int argc, char** argv) { - int c; - //int iOption = 0; - +void parseOptions(int argc, char** argv) +{ if(argc == 1) { printHelp(argv[0]); exit(0); } - while (1) { - - /* getopt_long stores the option index here. */ - int option_index = 0; - - c = getopt_long(argc, argv, "t:d:p:r:?v", long_options, &option_index); + while (true) { + int c = getopt_long(argc, argv, "t:d:p:r:?v", long_options, nullptr); /* Detect the end of the options. */ if(c == -1) { @@ -571,6 +580,12 @@ void parseOptions(int argc, char** argv) { g_iOptions |= OPT_SETMIPMNHASS; break; + case OPT_SET_RADIOMODE: + if (optarg) + g_sRadioMode = optarg; + g_iOptions |= OPT_SET_RADIOMODE; + break; + default: printf("OPTION: [%d] ABORTING!!\n", c); abort(); @@ -644,3 +659,28 @@ const char *code2str(MTS::IO::ICellularRadio::CODE code) { } return "Unknown"; } + +MTS::IO::ICellularRadio::RADIOMODE radioModeEnum(const std::string &mode) +{ + using namespace MTS::IO; + if (mode == "auto") + return ICellularRadio::RADIOMODE_AUTO; + else if (mode == "gsm") + return ICellularRadio::RADIOMODE_GSM_ONLY; + else if (mode == "umts") + return ICellularRadio::RADIOMODE_UMTS_ONLY; + else + return ICellularRadio::RADIOMODE_UNKNOWN; + +} + +const char* radioModeStr(MTS::IO::ICellularRadio::RADIOMODE mode) +{ + using namespace MTS::IO; + switch (mode) { + case ICellularRadio::RADIOMODE_GSM_ONLY : return "gsm"; + case ICellularRadio::RADIOMODE_UMTS_ONLY: return "umts"; + case ICellularRadio::RADIOMODE_AUTO : return "auto"; + default : return ""; + } +} -- cgit v1.2.3 From a9f2d8dbd9c02ef260a1a49ee3fa4aa599943df9 Mon Sep 17 00:00:00 2001 From: Serhii Kostiuk Date: Sat, 22 Jun 2019 14:10:35 +0300 Subject: [MTS-MTQ] SIM unlocking using the PIN code for radio-cmd Added a new "--unlock-sim-card" command --- main.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/main.cpp b/main.cpp index b74c9c6..52698fb 100644 --- a/main.cpp +++ b/main.cpp @@ -65,6 +65,7 @@ std::string g_sMIPMnHaSs; std::string g_sRxDiversity; std::string g_sActiveFirmware; std::string g_sConfigFile; +std::string g_sSimPin; Json::Value g_jData; MTS::AutoPtr g_apRadio; @@ -102,6 +103,7 @@ const uint32_t OPT_MSID = 0x00800000; const uint32_t OPT_SETRXDIVERSITY = 0x01000000; const uint32_t OPT_SETACTIVEFIRMWARE = 0x02000000; const uint32_t OPT_CONFIG_FILE = 0x04000000; +const uint32_t OPT_UNLOCK_SIM_CARD = 0x08000000; void handle_sigterm(int signum); void printHelp(const std::string& sApp); @@ -137,6 +139,7 @@ std::string loadImeiFromDeviceInfo(); { "set-mip-rev-tun", required_argument, 0, '7' }, { "set-mip-mn-aaa-ss", required_argument, 0, '8' }, { "set-mip-mn-ha-ss", required_argument, 0, '9' }, + { "unlock-sim-card", required_argument, 0, 'u' }, { "init-dc", no_argument, &iOption, OPT_INIT_DC }, { "init-fumo", no_argument, &iOption, OPT_INIT_FUMO }, { "init-prl", no_argument, &iOption, OPT_INIT_PRL }, @@ -358,6 +361,11 @@ int main(int argc, char** argv) { jArgs["fwid"] = g_sActiveFirmware; result = g_apRadio->setActiveFirmware(jArgs); printf("%s\n", code2str(result)); + } else if(g_iOptions & OPT_UNLOCK_SIM_CARD) { + Json::Value jArgs(Json::objectValue); + jArgs["pin"] = g_sSimPin; + result = g_apRadio->unlockSimCard(jArgs); + printf("%s\n", code2str(result)); } shutdown(); @@ -571,6 +579,13 @@ void parseOptions(int argc, char** argv) { g_iOptions |= OPT_SETMIPMNHASS; break; + case 'u': + if(optarg != 0) { + g_sSimPin = optarg; + } + g_iOptions |= OPT_UNLOCK_SIM_CARD; + break; + default: printf("OPTION: [%d] ABORTING!!\n", c); abort(); @@ -618,6 +633,7 @@ void printHelp(const std::string& sApp) { // Applicable for LTE910-NA1 dual FW images only // printf("\t--set-active-firmware : switch to a specific firmware image\n"); printf("\t--factory-default [ --msl ] : reset to factory defaults\n"); + printf("\t--unlock-sim-card : unlock the SIM card using the PIN code provided\n"); printf("\n"); printf("\t--printlvl (p) : sets the printlvl [0-100]\n"); printf("\t--version (v) : returns version\n"); -- cgit v1.2.3 From ba09313666f3139be6c468c583ecc68da3ac2390 Mon Sep 17 00:00:00 2001 From: Maksym Telychko Date: Mon, 24 Jun 2019 10:49:16 +0300 Subject: [MTS-MTQ] updated help for new option --- main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.cpp b/main.cpp index 5a01aea..fe33431 100644 --- a/main.cpp +++ b/main.cpp @@ -630,6 +630,8 @@ void printHelp(const std::string& sApp) { printf("\t--set-mip-mn-aaa-ss : set MIP MN AAA SS\n"); printf("\t--set-mip-mn-ha-ss : set MIP MN HA SS\n"); printf("\t--set-rx-diversity : set RX Diversity\n"); + printf("\t--get-radio-mode : get selected cellular network\n"); + printf("\t--set-radio-mode {auto|gsm|umts} : set cellular network\n"); // Applicable for LTE910-NA1 dual FW images only // printf("\t--set-active-firmware : switch to a specific firmware image\n"); printf("\t--factory-default [ --msl ] : reset to factory defaults\n"); -- cgit v1.2.3 From d7400de67508173f601ce30aaeae51bee2fdc8ff Mon Sep 17 00:00:00 2001 From: Maksym Telychko Date: Wed, 26 Jun 2019 13:14:31 +0300 Subject: [MTS-MTQ] RAT switch: refactoring parameter name --- main.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/main.cpp b/main.cpp index 5bd4f83..25b2f8d 100644 --- a/main.cpp +++ b/main.cpp @@ -115,8 +115,8 @@ void initializeCache(); void shutdown(); const char *code2str(MTS::IO::ICellularRadio::CODE code); std::string loadImeiFromDeviceInfo(); -MTS::IO::ICellularRadio::RADIOMODE radioModeEnum(const std::string &mode); -const char* radioModeStr(MTS::IO::ICellularRadio::RADIOMODE mode); +MTS::IO::ICellularRadio::RADIO_NETWORK_MODE radioModeEnum(const std::string &mode); +const char* radioModeStr(MTS::IO::ICellularRadio::RADIO_NETWORK_MODE mode); static int iOption = 0; @@ -144,9 +144,9 @@ static struct option long_options[] = { { "set-mip-rev-tun", required_argument, 0, '7' }, { "set-mip-mn-aaa-ss", required_argument, 0, '8' }, { "set-mip-mn-ha-ss", required_argument, 0, '9' }, - { "get-radio-mode", no_argument, &iOption, OPT_GET_RADIOMODE }, - { "set-radio-mode", required_argument, 0, OPT_SET_RADIOMODE }, { "unlock-sim-card", required_argument, 0, OPT_UNLOCK_SIM_CARD }, + { "get-radio-network-mode", no_argument, &iOption, OPT_GET_RADIOMODE }, + { "set-radio-network-mode", required_argument, 0, OPT_SET_RADIOMODE }, { "init-dc", no_argument, &iOption, OPT_INIT_DC }, { "init-fumo", no_argument, &iOption, OPT_INIT_FUMO }, { "init-prl", no_argument, &iOption, OPT_INIT_PRL }, @@ -370,11 +370,11 @@ int main(int argc, char** argv) { result = g_apRadio->setActiveFirmware(jArgs); printf("%s\n", code2str(result)); } else if(g_iOptions & OPT_GET_RADIOMODE) { - ICellularRadio::RADIOMODE mode; - g_apRadio->getRadioMode(mode); + ICellularRadio::RADIO_NETWORK_MODE mode; + g_apRadio->getRadioNetworkMode(mode); printf("%s\n", radioModeStr(mode)); } else if(g_iOptions & OPT_SET_RADIOMODE) { - ICellularRadio::CODE res = g_apRadio->setRadioMode(radioModeEnum(g_sRadioMode)); + ICellularRadio::CODE res = g_apRadio->setRadioNetworkMode(radioModeEnum(g_sRadioMode)); printf("%s\n", code2str(res)); } else if(g_iOptions & OPT_UNLOCK_SIM_CARD) { Json::Value jArgs(Json::objectValue); @@ -645,8 +645,8 @@ void printHelp(const std::string& sApp) { printf("\t--set-mip-mn-aaa-ss : set MIP MN AAA SS\n"); printf("\t--set-mip-mn-ha-ss : set MIP MN HA SS\n"); printf("\t--set-rx-diversity : set RX Diversity\n"); - printf("\t--get-radio-mode : get selected cellular network\n"); - printf("\t--set-radio-mode {auto|gsm|umts} : set cellular network\n"); + printf("\t--get-radio-network-mode : get selected cellular network\n"); + printf("\t--set-radio-network-mode {auto|gsm|umts} : set cellular network\n"); // Applicable for LTE910-NA1 dual FW images only // printf("\t--set-active-firmware : switch to a specific firmware image\n"); printf("\t--factory-default [ --msl ] : reset to factory defaults\n"); @@ -678,27 +678,27 @@ const char *code2str(MTS::IO::ICellularRadio::CODE code) { return "Unknown"; } -MTS::IO::ICellularRadio::RADIOMODE radioModeEnum(const std::string &mode) +MTS::IO::ICellularRadio::RADIO_NETWORK_MODE radioModeEnum(const std::string &mode) { using namespace MTS::IO; if (mode == "auto") - return ICellularRadio::RADIOMODE_AUTO; + return ICellularRadio::RADIO_NETWORK_MODE_AUTO; else if (mode == "gsm") - return ICellularRadio::RADIOMODE_GSM_ONLY; + return ICellularRadio::RADIO_NETWORK_MODE_GSM_ONLY; else if (mode == "umts") - return ICellularRadio::RADIOMODE_UMTS_ONLY; + return ICellularRadio::RADIO_NETWORK_MODE_UMTS_ONLY; else - return ICellularRadio::RADIOMODE_UNKNOWN; + return ICellularRadio::RADIO_NETWORK_MODE_UNKNOWN; } -const char* radioModeStr(MTS::IO::ICellularRadio::RADIOMODE mode) +const char* radioModeStr(MTS::IO::ICellularRadio::RADIO_NETWORK_MODE mode) { using namespace MTS::IO; switch (mode) { - case ICellularRadio::RADIOMODE_GSM_ONLY : return "gsm"; - case ICellularRadio::RADIOMODE_UMTS_ONLY: return "umts"; - case ICellularRadio::RADIOMODE_AUTO : return "auto"; + case ICellularRadio::RADIO_NETWORK_MODE_GSM_ONLY : return "gsm"; + case ICellularRadio::RADIO_NETWORK_MODE_UMTS_ONLY: return "umts"; + case ICellularRadio::RADIO_NETWORK_MODE_AUTO : return "auto"; default : return ""; } } -- cgit v1.2.3 From 28474b279248cc2a928cbec6073864828ba4d35c Mon Sep 17 00:00:00 2001 From: Serhii Kostiuk Date: Mon, 22 Jul 2019 10:34:17 +0300 Subject: [MTX-2890][IN:3756] MTR-MTQ - PPP Mode - Radio Reboot Enabled - Radio does not reboot Added radio reboot feature to the public interface of radio-cmd. This will allow to reboot the radio using AT commands in a uniform way from scripts and other components that may need it. --- main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.cpp b/main.cpp index 25b2f8d..d72faee 100644 --- a/main.cpp +++ b/main.cpp @@ -107,6 +107,7 @@ const uint32_t OPT_CONFIG_FILE = 0x04000000; const uint32_t OPT_GET_RADIOMODE = 0x08000000; const uint32_t OPT_SET_RADIOMODE = 0x10000000; const uint32_t OPT_UNLOCK_SIM_CARD = 0x20000000; +const uint32_t OPT_RESET_RADIO = 0x40000000; void handle_sigterm(int signum); void printHelp(const std::string& sApp); @@ -147,6 +148,7 @@ static struct option long_options[] = { { "unlock-sim-card", required_argument, 0, OPT_UNLOCK_SIM_CARD }, { "get-radio-network-mode", no_argument, &iOption, OPT_GET_RADIOMODE }, { "set-radio-network-mode", required_argument, 0, OPT_SET_RADIOMODE }, + { "reset-radio", no_argument, &iOption, OPT_RESET_RADIO }, { "init-dc", no_argument, &iOption, OPT_INIT_DC }, { "init-fumo", no_argument, &iOption, OPT_INIT_FUMO }, { "init-prl", no_argument, &iOption, OPT_INIT_PRL }, @@ -381,6 +383,10 @@ int main(int argc, char** argv) { jArgs["pin"] = g_sSimPin; result = g_apRadio->unlockSimCard(jArgs); printf("%s\n", code2str(result)); + } else if(g_iOptions & OPT_RESET_RADIO) { + bool ret = g_apRadio->resetRadio(); + result = (ret) ? ICellularRadio::CODE::SUCCESS : ICellularRadio::CODE::FAILURE; + printf("%s\n", code2str(result)); } shutdown(); @@ -651,6 +657,7 @@ void printHelp(const std::string& sApp) { // printf("\t--set-active-firmware : switch to a specific firmware image\n"); printf("\t--factory-default [ --msl ] : reset to factory defaults\n"); printf("\t--unlock-sim-card : unlock the SIM card using the PIN code provided\n"); + printf("\t--reset-radio : reset the radio module using AT commands\n"); printf("\n"); printf("\t--printlvl (p) : sets the printlvl [0-100]\n"); printf("\t--version (v) : returns version\n"); -- cgit v1.2.3