From 74fb4bb2d18bb1bd5b3a0ffa933064611a24de0d Mon Sep 17 00:00:00 2001 From: Mykyta Dorokhin Date: Tue, 8 May 2018 14:10:25 +0300 Subject: Add FTP FOTA upgrade functionality for ME910C1-NV radios Signed-off-by: Jeff Hatch --- main.cpp | 17 +++++++++++++++-- 1 file 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 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 [ -t -d ] : send AT command. Timeout and device are optional\n"); printf("\t--device (d) : 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 ] : initiate module/modem firmware update\n"); printf("\t--init-prl : initiate PRL update\n"); printf("\t--init-activation [ --msid --mdn ]\n"); printf("\t : initiate account activation. Some carriers require MDN and MSID\n"); -- cgit v1.2.3