summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2020-07-01 11:34:34 +0300
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2020-07-01 11:58:58 +0300
commit5096792c46621b03572f406262dc3c7d855981bf (patch)
tree03eeb3b0c4b35adddf10963bc47b884145374693
parent761cdbbb8652dc3569e78bea9d11e3db60d9f723 (diff)
downloadradio-cmd-5096792c46621b03572f406262dc3c7d855981bf.tar.gz
radio-cmd-5096792c46621b03572f406262dc3c7d855981bf.tar.bz2
radio-cmd-5096792c46621b03572f406262dc3c7d855981bf.zip
[GP-675] Quectel Delta Radio Firmware Upgrade support - radio-cmd implementation
Added an option to apply the delta upgrade file that was previously uploaded to the radio.
-rw-r--r--main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index ba8b268..eadf51b 100644
--- a/main.cpp
+++ b/main.cpp
@@ -114,6 +114,7 @@ const uint32_t OPT_RESET_RADIO = 0x40000000;
int32_t g_iAuxOptions = 0;
const uint32_t AOPT_OMA_DM_START = 0x00000001;
const uint32_t AOPT_DFU_UPLOAD = 0x00000002;
+const uint32_t AOPT_DFU_APPLY = 0x00000004;
void handle_sigterm(int signum);
void printHelp(const std::string& sApp);
@@ -160,6 +161,7 @@ static struct option long_options[] = {
{ "set-cellular-mode", required_argument, 0, 'w' },
{ "start-oma-dm", no_argument, 0, 'o' },
{ "delta-fwu-upload", required_argument, 0, 'x' },
+ { "delta-fwu-apply", no_argument, 0, 'F' },
{ 0, 0, 0, 0 }
};
@@ -399,6 +401,8 @@ int main(int argc, char** argv) {
result = g_apRadio->startOmaDm(cb);
} else if (g_iAuxOptions & AOPT_DFU_UPLOAD) {
result = handleDeltaFwUpload(g_sDeltaFwPath);
+ } else if (g_iAuxOptions & AOPT_DFU_APPLY) {
+ result = g_apRadio->applyDeltaFirmwareFile(cb);
}
shutdown();
@@ -629,6 +633,10 @@ void parseOptions(int argc, char** argv)
g_iAuxOptions |= AOPT_DFU_UPLOAD;
break;
+ case 'F':
+ g_iAuxOptions |= AOPT_DFU_APPLY;
+ break;
+
default:
printf("OPTION: [%d] ABORTING!!\n", c);
abort();
@@ -681,6 +689,7 @@ void printHelp(const std::string& sApp) {
printf("\t--reset-radio : reset the radio module using AT commands\n");
printf("\t--start-oma-dm : start the OMA DM procedure (selected radios and networks only)\n");
printf("\t--delta-fwu-upload <FILE_PATH> : upload a delta radio FWU file to the radio\n");
+ printf("\t--delta-fwu-apply : apply the delta radio FWU image that was already uploaded to the radio\n");
printf("\n");
printf("\t--printlvl (p) <level> : sets the printlvl [0-100]\n");
printf("\t--version (v) : returns version\n");