diff options
Diffstat (limited to 'src/MTS_IO_EG95Radio.cpp')
-rw-r--r-- | src/MTS_IO_EG95Radio.cpp | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/src/MTS_IO_EG95Radio.cpp b/src/MTS_IO_EG95Radio.cpp index f1c040a..296f183 100644 --- a/src/MTS_IO_EG95Radio.cpp +++ b/src/MTS_IO_EG95Radio.cpp @@ -18,14 +18,8 @@ * */ - #include <mts/MTS_IO_EG95Radio.h> -#include <climits> - -#include <mts/MTS_Logger.h> -#include <mts/MTS_Text.h> - using namespace MTS::IO; const std::string EG95Radio::MODEL_NAME("EG95"); @@ -54,36 +48,4 @@ ICellularRadio::CODE EG95Radio::setRxDiversity(const Json::Value& jArgs) { ICellularRadio::CODE EG95Radio::getSupportedCellularModes(CELLULAR_MODES &networks) { networks = static_cast<CELLULAR_MODES>(CELLULAR_MODE_2G | CELLULAR_MODE_3G | CELLULAR_MODE_4G); return SUCCESS; -} - -ICellularRadio::CODE EG95Radio::setCellularMode(CELLULAR_MODES networks) { - std::string prefNet; - unsigned int prefOnly = 0, prefCount = 0; - for (int i = sizeof(networks)*CHAR_BIT-1; i>=0; --i){ - switch (1<<i & networks) { - case ICellularRadio::CELLULAR_MODE_2G: prefNet += "01" ; prefOnly = 1; prefCount++; break; - case ICellularRadio::CELLULAR_MODE_3G: prefNet += "0302"; prefOnly = 2; prefCount++; break; - case ICellularRadio::CELLULAR_MODE_4G: prefNet += "04" ; prefOnly = 3; prefCount++; break; - } - } - - std::string sCmd; - if (prefCount == 1) { // *g-only - sCmd = "AT+QCFG=\"nwscanmode\"," + std::to_string(prefOnly); - } else { // preferred - sCmd = "AT+QCFG=\"nwscanmode\",0"; - } - std::string cmdResult = sendCommand(sCmd); - if (cmdResult.find(ICellularRadio::RSP_OK) == std::string::npos) { - 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) { - printError("%s| AT+QCFG=\"nwscanseq\" returned unexpected response: [%s][%s]", getName().c_str(), sCmd.c_str(), cmdResult.c_str()); - return FAILURE; - } - return SUCCESS; -} +}
\ No newline at end of file |