summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMykyta Dorokhin <mykyta.dorokhin@globallogic.com>2018-05-08 14:10:25 +0300
committerJeff Hatch <Jeff.Hatch@multitech.com>2018-05-08 13:36:31 -0500
commit74fb4bb2d18bb1bd5b3a0ffa933064611a24de0d (patch)
treedd9a85c264900acdaf4cbe40b1ed40218e39ee8e
parentb34df05982286b82dd70d4aec70df96ce6b08d0a (diff)
downloadradio-cmd-0.5.tar.gz
radio-cmd-0.5.tar.bz2
radio-cmd-0.5.zip
Add FTP FOTA upgrade functionality for ME910C1-NV radios0.5
Signed-off-by: Jeff Hatch <Jeff.Hatch@multitech.com>
-rw-r--r--main.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index 8a938aa..a5eeb97 100644
--- a/main.cpp
+++ b/main.cpp
@@ -64,6 +64,7 @@ std::string g_sMIPMnAaaSs;
std::string g_sMIPMnHaSs;
std::string g_sRxDiversity;
std::string g_sActiveFirmware;
+std::string g_sConfigFile;
Json::Value g_jData;
MTS::AutoPtr<MTS::IO::CellularRadio> g_apRadio;
@@ -100,6 +101,7 @@ const uint32_t OPT_MDN = 0x00400000;
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;
void handle_sigterm(int signum);
void printHelp(const std::string& sApp);
@@ -116,6 +118,7 @@ std::string loadImeiFromDeviceInfo();
{ "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' },
@@ -319,7 +322,10 @@ int main(int argc, char** argv) {
result = g_apRadio->updatePrl(jArgs, cb);
printf("%s\n", code2str(result));
} else if(g_iOptions & OPT_INIT_FUMO) {
- Json::Value jArgs(Json::nullValue);
+ Json::Value jArgs(Json::objectValue);
+ if(g_iOptions & OPT_CONFIG_FILE) {
+ jArgs["config-file"] = g_sConfigFile;
+ }
result = g_apRadio->updateFumo(jArgs, cb);
printf("%s\n", code2str(result));
} else if(g_iOptions & OPT_INIT_RTN) {
@@ -469,6 +475,13 @@ void parseOptions(int argc, char** argv) {
g_iOptions |= OPT_SETMSL;
break;
+ case 'c':
+ if(optarg != 0) {
+ g_sConfigFile = optarg;
+ }
+ g_iOptions |= OPT_CONFIG_FILE;
+ break;
+
case 'l':
if(optarg != 0) {
g_sMSL = optarg;
@@ -583,7 +596,7 @@ void printHelp(const std::string& sApp) {
printf("\t<AT_COMMAND> [ -t <TIMEOUT> -d <DEVICE> ] : send AT command. Timeout and device are optional\n");
printf("\t--device (d) <device> : modem device to use, default: /dev/modem_at1\n");
printf("\t--init-dc : initiate device configuration update\n");
- printf("\t--init-fumo : initiate module/modem firmware update\n");
+ printf("\t--init-fumo [ --config-file <PATH> ] : initiate module/modem firmware update\n");
printf("\t--init-prl : initiate PRL update\n");
printf("\t--init-activation [ --msid <MSID> --mdn <MDN>]\n");
printf("\t : initiate account activation. Some carriers require MDN and MSID\n");