diff options
author | Mykyta Dorokhin <mykyta.dorokhin@globallogic.com> | 2018-05-08 14:10:25 +0300 |
---|---|---|
committer | Jeff Hatch <Jeff.Hatch@multitech.com> | 2018-05-08 13:36:31 -0500 |
commit | 74fb4bb2d18bb1bd5b3a0ffa933064611a24de0d (patch) | |
tree | dd9a85c264900acdaf4cbe40b1ed40218e39ee8e | |
parent | b34df05982286b82dd70d4aec70df96ce6b08d0a (diff) | |
download | radio-cmd-74fb4bb2d18bb1bd5b3a0ffa933064611a24de0d.tar.gz radio-cmd-74fb4bb2d18bb1bd5b3a0ffa933064611a24de0d.tar.bz2 radio-cmd-74fb4bb2d18bb1bd5b3a0ffa933064611a24de0d.zip |
Add FTP FOTA upgrade functionality for ME910C1-NV radios0.5
Signed-off-by: Jeff Hatch <Jeff.Hatch@multitech.com>
-rw-r--r-- | main.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -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"); |