From 5096792c46621b03572f406262dc3c7d855981bf Mon Sep 17 00:00:00 2001 From: Serhii Kostiuk Date: Wed, 1 Jul 2020 11:34:34 +0300 Subject: [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. --- main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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 : 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) : sets the printlvl [0-100]\n"); printf("\t--version (v) : returns version\n"); -- cgit v1.2.3