summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMykola Salomatin <mykola.salomatin@globallogic.com>2022-04-21 12:14:57 +0300
committerJohn Klug <john.klug@multitech.com>2022-06-17 10:26:42 -0500
commit117b5c87afafb24500f820942f5f6724c426ad11 (patch)
tree0e8d076902085f2c9088ab5f590d989b34dadc24
parent4322fabc71ddc54c19dd0e54a0b5248da372e9e5 (diff)
downloadlibmts-io-117b5c87afafb24500f820942f5f6724c426ad11.tar.gz
libmts-io-117b5c87afafb24500f820942f5f6724c426ad11.tar.bz2
libmts-io-117b5c87afafb24500f820942f5f6724c426ad11.zip
[MTX-4445] mPower R.6.0.X: MTCAP3: LNA7D - cellular radio support GP-1548
Fix LNA7D delta radio firmware upgrade issue (handling double radio reset).
-rw-r--r--src/MTS_IO_QuectelRadio.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/MTS_IO_QuectelRadio.cpp b/src/MTS_IO_QuectelRadio.cpp
index b1e1e59..9c5b3d5 100644
--- a/src/MTS_IO_QuectelRadio.cpp
+++ b/src/MTS_IO_QuectelRadio.cpp
@@ -1044,6 +1044,7 @@ uint16_t QuectelRadio::getQuectelChecksum(const void* data, size_t nBytes) {
ICellularRadio::CODE QuectelRadio::fumoWaitUpgradeFinished(ICellularRadio::UpdateCb& stepCb) {
const uint32_t duUrcTimeout = 4 * 60 * 1000; // wait for 4 minutes for the next URC message
+ const uint32_t duAttachTimeout = 30 * 1000; // wait up to 30 seconds for the radio to attach
const std::string sFotaUrcPrefix = "+QIND: \"FOTA\""; // prefix for the URC notification messages
const std::string sFotaUrcStart = "\"START\"";
const std::string sFotaUrcProgress = "\"UPDATING\"";
@@ -1058,6 +1059,18 @@ ICellularRadio::CODE QuectelRadio::fumoWaitUpgradeFinished(ICellularRadio::Updat
sResponse = waitResponse(vFotaBailStrings, duUrcTimeout);
printTrace("Radio response: [%s]", sResponse.c_str());
+ if (sResponse.empty()) {
+ // Radio detached again. Try to reconnect
+ if (!resetConnection(duAttachTimeout)) {
+ printError("Can't connect to the radio in %d ms", (duAttachTimeout));
+ callNextStep(stepCb, "FUMO Error: unable to obtain radio after second reset");
+ return ERROR;
+ }
+
+ sResponse = waitResponse(vFotaBailStrings, duUrcTimeout);
+ printTrace("Radio response: [%s]", sResponse.c_str());
+ }
+
if (sResponse.find(sFotaUrcPrefix) == std::string::npos) {
printError("No URC messages from the radio in %d ms", duUrcTimeout);
callNextStep(stepCb, "FUMO Error: timeout, radio is not responding");