summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/MTS_IO_CellularRadio.cpp6
-rw-r--r--src/MTS_IO_EG95Radio.cpp4
-rw-r--r--src/MTS_IO_TelitRadio.cpp14
3 files changed, 12 insertions, 12 deletions
diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp
index e171341..6df92e0 100644
--- a/src/MTS_IO_CellularRadio.cpp
+++ b/src/MTS_IO_CellularRadio.cpp
@@ -774,7 +774,7 @@ ICellularRadio::CODE CellularRadio::getCellularMode(CELLULAR_MODES &networks) {
networks = CELLULAR_MODE_NA;
std::string cmdResult = sendCommand("AT+COPS?");
if (cmdResult.find(ICellularRadio::RSP_OK) == std::string::npos) {
- printDebug("%s| AT+COPS returned unexpected response: AT+COPS? [%s]", getName().c_str(), cmdResult.c_str());
+ printError("%s| AT+COPS returned unexpected response: AT+COPS? [%s]", getName().c_str(), cmdResult.c_str());
return FAILURE;
}
@@ -782,7 +782,7 @@ ICellularRadio::CODE CellularRadio::getCellularMode(CELLULAR_MODES &networks) {
const std::vector<std::string> &reply = MTS::Text::split(MTS::Text::getLine(MTS::Text::trim(cmdResult), cursor, cursor), ',');
uint8_t op;
if (reply.size() < 4 || !MTS::Text::parse(op, reply[3])) {
- printDebug("Error parsing reply from AT+COPS");
+ printError("%s| AT+COPS Error parsing reply [AT+COPS?][%s]", getName().c_str(), cmdResult.c_str());
return FAILURE;
}
if (op == 0) {
@@ -792,7 +792,7 @@ ICellularRadio::CODE CellularRadio::getCellularMode(CELLULAR_MODES &networks) {
} else if (op == 7) {
networks = CELLULAR_MODE_4G;
} else {
- printDebug("Error: AT+COPS unknown Radio Access Technology");
+ printError("%s| AT+COPS unknown Radio Access Technology [AT+COPS?][%s]", getName().c_str(), cmdResult.c_str());
return FAILURE;
}
return SUCCESS;
diff --git a/src/MTS_IO_EG95Radio.cpp b/src/MTS_IO_EG95Radio.cpp
index 7705e64..aff53d2 100644
--- a/src/MTS_IO_EG95Radio.cpp
+++ b/src/MTS_IO_EG95Radio.cpp
@@ -76,14 +76,14 @@ ICellularRadio::CODE EG95Radio::setCellularMode(CELLULAR_MODES networks) {
}
std::string cmdResult = sendCommand(sCmd);
if (cmdResult.find(ICellularRadio::RSP_OK) == std::string::npos) {
- printDebug("%s| AT+QCFG=\"nwscanmode\" returned unexpected response: [%s][%s]", getName().c_str(), sCmd.c_str(), cmdResult.c_str());
+ printError("%s| AT+QCFG=\"nwscanmode\" returned unexpected response: [%s][%s]", getName().c_str(), sCmd.c_str(), cmdResult.c_str());
return FAILURE;
}
sCmd = "AT+QCFG=\"nwscanseq\"," + prefNet;
cmdResult = sendCommand(sCmd);
if (cmdResult.find(ICellularRadio::RSP_OK) == std::string::npos) {
- printDebug("%s| AT+QCFG=\"nwscanseq\" returned unexpected response: [%s][%s]", getName().c_str(), sCmd.c_str(), cmdResult.c_str());
+ printError("%s| AT+QCFG=\"nwscanseq\" returned unexpected response: [%s][%s]", getName().c_str(), sCmd.c_str(), cmdResult.c_str());
return FAILURE;
}
return SUCCESS;
diff --git a/src/MTS_IO_TelitRadio.cpp b/src/MTS_IO_TelitRadio.cpp
index 7e74ca6..5b8e55d 100644
--- a/src/MTS_IO_TelitRadio.cpp
+++ b/src/MTS_IO_TelitRadio.cpp
@@ -634,12 +634,12 @@ ICellularRadio::CODE TelitRadio::getSupportedCellularModes(CELLULAR_MODES &netwo
std::string sCmd("AT+WS46=?");
std::string cmdResult = sendCommand(sCmd);
if (cmdResult.find("+WS46:") == std::string::npos) {
- printDebug("%s| AT+WS46=? returned unexpected response: [%s][%s]", getName().c_str(), sCmd.c_str(), cmdResult.c_str());
+ printError("%s| AT+WS46=? returned unexpected response: [%s][%s]", getName().c_str(), sCmd.c_str(), cmdResult.c_str());
return FAILURE;
}
if (cmdResult.find('(') == std::string::npos) {
- printDebug("AT+WS46: error responce %s", cmdResult.c_str());
+ printError("AT+WS46: error responce %s", cmdResult.c_str());
return FAILURE;
}
std::string s = MTS::Text::split(cmdResult, '(')[1];
@@ -652,7 +652,7 @@ ICellularRadio::CODE TelitRadio::getSupportedCellularModes(CELLULAR_MODES &netwo
const std::vector<std::string> &r = MTS::Text::split(it, "-");
int begin, end;
if ( ! MTS::Text::parse(begin, r[0]) || ! MTS::Text::parse(end, r[1])) {
- printDebug("AT+WS46: error parsing network mode range: %s-%s", r[0].c_str(), r[1].c_str());
+ printError("AT+WS46: error parsing network mode range: %s-%s", r[0].c_str(), r[1].c_str());
return FAILURE;
}
for (int i = begin; i<=end; ++i) {
@@ -663,14 +663,14 @@ ICellularRadio::CODE TelitRadio::getSupportedCellularModes(CELLULAR_MODES &netwo
} else {
int v;
if ( ! MTS::Text::parse(v, it)) {
- printDebug("AT+WS46: error parsing network mode: %s", it.c_str());
+ printError("AT+WS46: error parsing network mode: %s", it.c_str());
return FAILURE;
}
m.push_back(v);
}
}
if (m.size()>1024) {
- printDebug("AT+WS46: network modes count overflow, parsing error");
+ printError("AT+WS46: network modes count overflow, parsing error");
return FAILURE;
}
@@ -707,7 +707,7 @@ ICellularRadio::CODE TelitRadio::setCellularMode(CELLULAR_MODES networks) {
sCmd += std::to_string(wds);
std::string cmdResult = sendCommand(sCmd);
if (cmdResult.find(ICellularRadio::RSP_OK) == std::string::npos) {
- printDebug("%s| AT+WS46= returned unexpected response: [%s][%s]", getName().c_str(), sCmd.c_str(), cmdResult.c_str());
+ printError("%s| AT+WS46= returned unexpected response: [%s][%s]", getName().c_str(), sCmd.c_str(), cmdResult.c_str());
return FAILURE;
}
return SUCCESS;
@@ -735,7 +735,7 @@ ICellularRadio::CELLULAR_MODES TelitRadio::preferredNetwork(CELLULAR_MODES prefN
case 41: result |= CELLULAR_MODE_2G | CELLULAR_MODE_3G | CELLULAR_MODE_5G; break;
case 42: result |= CELLULAR_MODE_2G | CELLULAR_MODE_5G; break;
default:
- printDebug("AT+WS46: unhandled network mode: %d", wds);
+ printError("AT+WS46: unhandled network mode: %d", wds);
break;
}
return static_cast<CELLULAR_MODES>(result);