summaryrefslogtreecommitdiff
path: root/src/MTS_IO_QuectelRadio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/MTS_IO_QuectelRadio.cpp')
-rw-r--r--src/MTS_IO_QuectelRadio.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/MTS_IO_QuectelRadio.cpp b/src/MTS_IO_QuectelRadio.cpp
index 0c0c8ab..655fb38 100644
--- a/src/MTS_IO_QuectelRadio.cpp
+++ b/src/MTS_IO_QuectelRadio.cpp
@@ -1675,3 +1675,28 @@ const std::vector<std::string>& QuectelRadio::getDiagCommands(bool) {
return vCommands;
}
+
+ICellularRadio::CODE QuectelRadio::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 command enables/disables the automatic time zone update
+ 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