summaryrefslogtreecommitdiff
path: root/src/MTS_IO_SequansRadio.cpp
diff options
context:
space:
mode:
authorsdesai <sdesai@multitech.com>2023-03-20 14:32:37 -0500
committersdesai <sdesai@multitech.com>2023-03-20 14:32:37 -0500
commit8fce7442bbc63b744905f9febc21aad9cf5074fd (patch)
tree2e78f36932d43d1eaa2b7c3f49f9349c9573d557 /src/MTS_IO_SequansRadio.cpp
parent050834e3cdd0f5f56ba15b09ca568ac6312c7699 (diff)
downloadlibmts-io-8fce7442bbc63b744905f9febc21aad9cf5074fd.tar.gz
libmts-io-8fce7442bbc63b744905f9febc21aad9cf5074fd.tar.bz2
libmts-io-8fce7442bbc63b744905f9febc21aad9cf5074fd.zip
Support Portal Case #5086148: use Cellular Radio timeas alternative to GPS or NTP
Diffstat (limited to 'src/MTS_IO_SequansRadio.cpp')
-rw-r--r--src/MTS_IO_SequansRadio.cpp26
1 files changed, 12 insertions, 14 deletions
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<std::string>& 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