summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp33
1 files changed, 25 insertions, 8 deletions
diff --git a/main.cpp b/main.cpp
index 0cada99..8a938aa 100644
--- a/main.cpp
+++ b/main.cpp
@@ -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");