summaryrefslogtreecommitdiff
path: root/src/MTS_IO_EG95Radio.cpp
diff options
context:
space:
mode:
authormykola.salomatin <mykola.salomatin@globallogic.com>2020-05-29 11:44:57 +0300
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2020-05-29 11:49:24 +0300
commit04b90430c91f4257ebeff3bcccbe8c5d7413e7ae (patch)
tree64f6423de18f09e5791d9c5da216a5cfe4bc4fd0 /src/MTS_IO_EG95Radio.cpp
parentb3a9a71afdb0d6f4f104543cedba89d011ca68df (diff)
downloadlibmts-io-04b90430c91f4257ebeff3bcccbe8c5d7413e7ae.tar.gz
libmts-io-04b90430c91f4257ebeff3bcccbe8c5d7413e7ae.tar.bz2
libmts-io-04b90430c91f4257ebeff3bcccbe8c5d7413e7ae.zip
mPower Oct20: L4G1 libmts-io support
Diffstat (limited to 'src/MTS_IO_EG95Radio.cpp')
-rw-r--r--src/MTS_IO_EG95Radio.cpp40
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