From 2e2359fd17c4d1fb7e7ef37aceccf766dd262d0b Mon Sep 17 00:00:00 2001 From: Mykola Salomatin Date: Wed, 15 Mar 2023 10:46:04 +0200 Subject: Fixed use of uninitialized variable --- src/MTS_IO_SequansRadio.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/MTS_IO_SequansRadio.cpp') diff --git a/src/MTS_IO_SequansRadio.cpp b/src/MTS_IO_SequansRadio.cpp index 8133bbf..380dd80 100644 --- a/src/MTS_IO_SequansRadio.cpp +++ b/src/MTS_IO_SequansRadio.cpp @@ -282,7 +282,6 @@ ICellularRadio::CODE SequansRadio::getNetworkStatusTxPower(Json::Value& jData, J std::string sResult; std::string sPrefix; std::vector vParts; - int iValue; CODE rc; sCmd = "AT+SQNQRUP?"; @@ -312,7 +311,7 @@ ICellularRadio::CODE SequansRadio::getNetworkStatusTxPower(Json::Value& jData, J break; // invalid, not known or not detectable } if (fTxPow < -255 || fTxPow > 99) { - printDebug("%s| Network Status command returned unexpected value of txPower: [%s][%d]", getName().c_str(), sCmd.c_str(), iValue); + printDebug("%s| Network Status command returned unexpected value of txPower: [%s][%f]", getName().c_str(), sCmd.c_str(), fTxPow); break; } jDebug[ICellularRadio::KEY_TXPWR] = vParts[0]; -- cgit v1.2.3 From 050834e3cdd0f5f56ba15b09ca568ac6312c7699 Mon Sep 17 00:00:00 2001 From: sdesai Date: Wed, 15 Mar 2023 15:22:04 -0500 Subject: GP-139:Support Portal Case #5086148: use Cellular Radio timeas alternative to GPS or NTP --- src/MTS_IO_SequansRadio.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/MTS_IO_SequansRadio.cpp') diff --git a/src/MTS_IO_SequansRadio.cpp b/src/MTS_IO_SequansRadio.cpp index a48a309..33bd068 100644 --- a/src/MTS_IO_SequansRadio.cpp +++ b/src/MTS_IO_SequansRadio.cpp @@ -568,3 +568,28 @@ const std::vector& SequansRadio::getDiagCommands(bool) { return vCommands; } + +ICellularRadio::CODE SequansRadio::getTimeUTC(void) { + printTrace("%s| Get Time in UTC", getName().c_str()); + + // Set year format in YYYY first, in case it is in YY format to get accurate year + std::string sCmdCSDF("AT+CSDF=1,2"); + std::string sRes = sendCommand(sCmdCSDF); + size_t endr = sRes.find(ICellularRadio::RSP_OK); + + if (endr == std::string::npos) { + printWarning("%s| Unable to set year format for radio using command [%s]", getName().c_str(), sCmdCSDF.c_str()); + return FAILURE; + } + + // Set year format in YYYY first, in case it is in YY format to get accurate year + std::string sCmdCTZU("AT+CTZU=1"); + sRes = sendCommand(sCmdCTZU); + size_t endc = sRes.find(ICellularRadio::RSP_OK); + + if (endc == std::string::npos) { + printWarning("%s| Unable to set automatic time zone update for radio using command [%s]", getName().c_str(), sCmdCTZU.c_str()); + return FAILURE; + } + return SUCCESS; +} \ No newline at end of file -- cgit v1.2.3 From 8fce7442bbc63b744905f9febc21aad9cf5074fd Mon Sep 17 00:00:00 2001 From: sdesai Date: Mon, 20 Mar 2023 14:32:37 -0500 Subject: Support Portal Case #5086148: use Cellular Radio timeas alternative to GPS or NTP --- src/MTS_IO_SequansRadio.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'src/MTS_IO_SequansRadio.cpp') diff --git a/src/MTS_IO_SequansRadio.cpp b/src/MTS_IO_SequansRadio.cpp index 33bd068..31c736f 100644 --- a/src/MTS_IO_SequansRadio.cpp +++ b/src/MTS_IO_SequansRadio.cpp @@ -569,27 +569,25 @@ const std::vector& SequansRadio::getDiagCommands(bool) { return vCommands; } -ICellularRadio::CODE SequansRadio::getTimeUTC(void) { - printTrace("%s| Get Time in UTC", getName().c_str()); - +ICellularRadio::CODE SequansRadio::setTimeFormat() { + printTrace("%s| Set standard time format", getName().c_str()); + ICellularRadio::CODE rc; // Set year format in YYYY first, in case it is in YY format to get accurate year std::string sCmdCSDF("AT+CSDF=1,2"); - std::string sRes = sendCommand(sCmdCSDF); - size_t endr = sRes.find(ICellularRadio::RSP_OK); + rc = sendBasicCommand(sCmdCSDF); - if (endr == std::string::npos) { - printWarning("%s| Unable to set year format for radio using command [%s]", getName().c_str(), sCmdCSDF.c_str()); - return FAILURE; + if (rc != SUCCESS) { + printError("%s| Failed to set diversity for WCDMA network mode: [%d]", getName().c_str(), rc); + return rc; } - // Set year format in YYYY first, in case it is in YY format to get accurate year + // Set command enables the automatic time zone update std::string sCmdCTZU("AT+CTZU=1"); - sRes = sendCommand(sCmdCTZU); - size_t endc = sRes.find(ICellularRadio::RSP_OK); + rc = sendBasicCommand(sCmdCTZU); - if (endc == std::string::npos) { - printWarning("%s| Unable to set automatic time zone update for radio using command [%s]", getName().c_str(), sCmdCTZU.c_str()); - return FAILURE; + if (rc != SUCCESS) { + printError("%s| Failed to set diversity for WCDMA network mode: [%d]", getName().c_str(), rc); + return rc; } return SUCCESS; } \ No newline at end of file -- cgit v1.2.3 From 96a6958ec2242d1ff7bc0afa83e25044e61800e1 Mon Sep 17 00:00:00 2001 From: sdesai Date: Mon, 20 Mar 2023 15:19:05 -0500 Subject: Support Portal Case #5086148: use Cellular Radio timeas alternative to GPS or NTP --- src/MTS_IO_SequansRadio.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/MTS_IO_SequansRadio.cpp') diff --git a/src/MTS_IO_SequansRadio.cpp b/src/MTS_IO_SequansRadio.cpp index 31c736f..d2a2efb 100644 --- a/src/MTS_IO_SequansRadio.cpp +++ b/src/MTS_IO_SequansRadio.cpp @@ -577,7 +577,7 @@ ICellularRadio::CODE SequansRadio::setTimeFormat() { rc = sendBasicCommand(sCmdCSDF); if (rc != SUCCESS) { - printError("%s| Failed to set diversity for WCDMA network mode: [%d]", getName().c_str(), rc); + printError("%s| Unable to set year format for radio using command [%s]", getName().c_str(), sCmdCSDF.c_str()); return rc; } @@ -586,7 +586,7 @@ ICellularRadio::CODE SequansRadio::setTimeFormat() { rc = sendBasicCommand(sCmdCTZU); if (rc != SUCCESS) { - printError("%s| Failed to set diversity for WCDMA network mode: [%d]", getName().c_str(), rc); + printError("%s| Unable to set automatic time zone update for radio using command [%s]", getName().c_str(), sCmdCTZU.c_str()); return rc; } return SUCCESS; -- cgit v1.2.3 From 23f75ed608922db0c22a01d74f1b38f0bfed43dd Mon Sep 17 00:00:00 2001 From: sdesai Date: Fri, 24 Mar 2023 17:40:31 -0500 Subject: Support Portal Case #5086148: use Cellular Radio time as alternative to GPS or NTP --- src/MTS_IO_SequansRadio.cpp | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'src/MTS_IO_SequansRadio.cpp') diff --git a/src/MTS_IO_SequansRadio.cpp b/src/MTS_IO_SequansRadio.cpp index d2a2efb..5f85b58 100644 --- a/src/MTS_IO_SequansRadio.cpp +++ b/src/MTS_IO_SequansRadio.cpp @@ -570,24 +570,6 @@ const std::vector& SequansRadio::getDiagCommands(bool) { } ICellularRadio::CODE SequansRadio::setTimeFormat() { - printTrace("%s| Set standard time format", getName().c_str()); - ICellularRadio::CODE rc; - // Set year format in YYYY first, in case it is in YY format to get accurate year - std::string sCmdCSDF("AT+CSDF=1,2"); - rc = sendBasicCommand(sCmdCSDF); - - if (rc != SUCCESS) { - printError("%s| Unable to set year format for radio using command [%s]", getName().c_str(), sCmdCSDF.c_str()); - return rc; - } - - // Set command enables the automatic time zone update - std::string sCmdCTZU("AT+CTZU=1"); - rc = sendBasicCommand(sCmdCTZU); - - if (rc != SUCCESS) { - printError("%s| Unable to set automatic time zone update for radio using command [%s]", getName().c_str(), sCmdCTZU.c_str()); - return rc; - } - return SUCCESS; -} \ No newline at end of file + // AT+CSDF does not work on CB610L. Also, since CB610L does not return the correct time anyway. + return NOT_APPLICABLE; +} -- cgit v1.2.3