diff options
author | Jeff Hatch <Jeff.Hatch@multitech.com> | 2017-06-02 16:27:36 -0500 |
---|---|---|
committer | Jeff Hatch <Jeff.Hatch@multitech.com> | 2017-06-02 16:27:36 -0500 |
commit | b34df05982286b82dd70d4aec70df96ce6b08d0a (patch) | |
tree | 68a116cae3e022fddf99ef0df367d020bb725b9d | |
parent | 14273be01c47845b85626488229c4e94802f3458 (diff) | |
download | radio-cmd-b34df05982286b82dd70d4aec70df96ce6b08d0a.tar.gz radio-cmd-b34df05982286b82dd70d4aec70df96ce6b08d0a.tar.bz2 radio-cmd-b34df05982286b82dd70d4aec70df96ce6b08d0a.zip |
Add AT#FWSWITCH support for LNA radio0.4
-rw-r--r-- | main.cpp | 33 |
1 files changed, 25 insertions, 8 deletions
@@ -63,6 +63,7 @@ std::string g_sMIPRevTun; std::string g_sMIPMnAaaSs; std::string g_sMIPMnHaSs; std::string g_sRxDiversity; +std::string g_sActiveFirmware; Json::Value g_jData; MTS::AutoPtr<MTS::IO::CellularRadio> g_apRadio; @@ -98,6 +99,7 @@ const uint32_t OPT_INIT_ACTIVATION = 0x00200000; const uint32_t OPT_MDN = 0x00400000; const uint32_t OPT_MSID = 0x00800000; const uint32_t OPT_SETRXDIVERSITY = 0x01000000; +const uint32_t OPT_SETACTIVEFIRMWARE = 0x02000000; void handle_sigterm(int signum); void printHelp(const std::string& sApp); @@ -120,7 +122,8 @@ std::string loadImeiFromDeviceInfo(); { "msl", required_argument, 0, 'l' }, { "mdn", required_argument, 0, 'k' }, { "msid", required_argument, 0, 'j' }, - { "set-rx-diversity", required_argument, 0, 'r' }, + { "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' }, @@ -343,7 +346,12 @@ int main(int argc, char** argv) { Json::Value jArgs(Json::objectValue); jArgs["enabled"] = g_sRxDiversity; result = g_apRadio->setRxDiversity(jArgs); - printf("%s\n", code2str(result)); + printf("%s\n", code2str(result)); + } else if(g_iOptions & OPT_SETACTIVEFIRMWARE) { + Json::Value jArgs(Json::objectValue); + jArgs["fwid"] = g_sActiveFirmware; + result = g_apRadio->setActiveFirmware(jArgs); + printf("%s\n", code2str(result)); } shutdown(); @@ -412,12 +420,19 @@ void parseOptions(int argc, char** argv) { } break; - case 'r': - if(optarg != 0) { - g_sRxDiversity = optarg; - } - g_iOptions |= OPT_SETRXDIVERSITY; - break; + case 'r': + if(optarg != 0) { + g_sRxDiversity = optarg; + } + g_iOptions |= OPT_SETRXDIVERSITY; + break; + + case 'f': + if(optarg != 0) { + g_sActiveFirmware = optarg; + } + g_iOptions |= OPT_SETACTIVEFIRMWARE; + break; case 't': if(optarg != 0) { @@ -587,6 +602,8 @@ void printHelp(const std::string& sApp) { printf("\t--set-mip-mn-aaa-ss <VAL> : set MIP MN AAA SS\n"); printf("\t--set-mip-mn-ha-ss <VAL> : set MIP MN HA SS\n"); printf("\t--set-rx-diversity <VAL> : set RX Diversity\n"); + // Applicable for LTE910-NA1 dual FW images only + // printf("\t--set-active-firmware <VAL> : switch to a specific firmware image\n"); printf("\t--factory-default [ --msl <MSL> ] : reset to factory defaults\n"); printf("\n"); printf("\t--printlvl (p) <level> : sets the printlvl [0-100]\n"); |