summaryrefslogtreecommitdiff
path: root/src/MTS_IO_TelitRadio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/MTS_IO_TelitRadio.cpp')
-rw-r--r--src/MTS_IO_TelitRadio.cpp39
1 files changed, 13 insertions, 26 deletions
diff --git a/src/MTS_IO_TelitRadio.cpp b/src/MTS_IO_TelitRadio.cpp
index 2c50208..be307e6 100644
--- a/src/MTS_IO_TelitRadio.cpp
+++ b/src/MTS_IO_TelitRadio.cpp
@@ -1213,38 +1213,25 @@ const std::vector<std::string>& TelitRadio::getDiagCommands(bool) {
return vCommands;
}
-ICellularRadio::CODE TelitRadio::getTimeUTC(void) {
- printTrace("%s| Get Time in UTC", getName().c_str());
-
+ICellularRadio::CODE TelitRadio::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| Unable to set year format for radio using command [%s]", getName().c_str(), sCmdCSDF.c_str());
+ return rc;
}
- // Set command enables/disables the automatic time zone update via NITZ.
+ // 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 year format for radio using command [%s]", getName().c_str(), sCmdCTZU.c_str());
- return FAILURE;
- }
-
- //Enables/disables the automatic date/time updating and the
- //Full Network Name applying. It enables also the #NITZ URC in the format.
- std::string sCmdNITZ("AT#NITZ");
- sRes = sendCommand(sCmdNITZ);
- size_t endn = sRes.find(ICellularRadio::RSP_OK);
-
- if (endn == std::string::npos) {
- printWarning("%s| Unable to set automatic time zone update for radio using command [%s]", getName().c_str(), sCmdNITZ.c_str());
- return FAILURE;
+ 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
+}