summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksym Telychko <maksym.telychko@globallogic.com>2019-07-31 14:30:04 +0300
committerMaksym Telychko <maksym.telychko@globallogic.com>2019-07-31 14:30:04 +0300
commite8412ebb27c8ff995795951d609377b003c8d6b1 (patch)
treea3ff0cc1aa56fac5228f341bd44031573b56db71
parentdf51426afd369bec64597eb922b6f6cc87d1f5ac (diff)
downloadlibmts-io-e8412ebb27c8ff995795951d609377b003c8d6b1.tar.gz
libmts-io-e8412ebb27c8ff995795951d609377b003c8d6b1.tar.bz2
libmts-io-e8412ebb27c8ff995795951d609377b003c8d6b1.zip
Removed obsolete methods get/set radio mode
Use get/setCellularMode instead Revert of commits: 4ef332ec707946a3cf2a55473d05dfc9af3d4b11 [MTS-MTQ] network radio mode switch: refactoring method name 143feb6a4587817d28c77e4df3a1b594b855f5e5 [MTS-MTQ] RAT mode switch: implementation for telit and quectel
-rw-r--r--include/mts/MTS_IO_ICellularRadio.h10
-rw-r--r--include/mts/MTS_IO_QuectelRadio.h2
-rw-r--r--include/mts/MTS_IO_TelitRadio.h2
-rw-r--r--src/MTS_IO_QuectelRadio.cpp42
-rw-r--r--src/MTS_IO_TelitRadio.cpp37
5 files changed, 0 insertions, 93 deletions
diff --git a/include/mts/MTS_IO_ICellularRadio.h b/include/mts/MTS_IO_ICellularRadio.h
index ce1a91e..57d6f53 100644
--- a/include/mts/MTS_IO_ICellularRadio.h
+++ b/include/mts/MTS_IO_ICellularRadio.h
@@ -60,14 +60,6 @@ namespace MTS {
NOT_INSERTED
};
- enum RADIO_NETWORK_MODE : uint8_t {
- RADIO_NETWORK_MODE_UNKNOWN = 0,
- RADIO_NETWORK_MODE_AUTO,
- RADIO_NETWORK_MODE_GSM_ONLY,
- RADIO_NETWORK_MODE_UMTS_ONLY,
- RADIO_NETWORK_MODE_LTE_ONLY
- };
-
enum CELLULAR_MODES : uint8_t {
CELLULAR_MODE_NA = 0, // NOT AVAILABLE
CELLULAR_MODE_2G = 1 << 0, // GSM
@@ -293,8 +285,6 @@ namespace MTS {
* or on any other error).
*/
virtual CODE unlockSimCard(const Json::Value& jArgs) = 0;
- virtual CODE getRadioNetworkMode(RADIO_NETWORK_MODE &mode) = 0;
- virtual CODE setRadioNetworkMode(RADIO_NETWORK_MODE mode) = 0;
//! Gather details of the radio's Mobile IP Profile
/*!
diff --git a/include/mts/MTS_IO_QuectelRadio.h b/include/mts/MTS_IO_QuectelRadio.h
index 3b1ba5a..df3b5b5 100644
--- a/include/mts/MTS_IO_QuectelRadio.h
+++ b/include/mts/MTS_IO_QuectelRadio.h
@@ -41,8 +41,6 @@ namespace MTS {
CODE convertdBmToSignalStrength(const int32_t& dBm, int32_t& iRssi) override;
CODE setMdn(const Json::Value& jArgs) override;
- CODE getRadioNetworkMode(RADIO_NETWORK_MODE &mode) override;
- CODE setRadioNetworkMode(RADIO_NETWORK_MODE mode) override;
protected:
QuectelRadio(const std::string& sName, const std::string& sRadioPort);
diff --git a/include/mts/MTS_IO_TelitRadio.h b/include/mts/MTS_IO_TelitRadio.h
index fc041cf..991f630 100644
--- a/include/mts/MTS_IO_TelitRadio.h
+++ b/include/mts/MTS_IO_TelitRadio.h
@@ -39,8 +39,6 @@ namespace MTS {
CODE convertdBmToSignalStrength(const int32_t& dBm, int32_t& iRssi) override;
CODE setMdn(const Json::Value& jArgs) override;
- CODE getRadioNetworkMode(RADIO_NETWORK_MODE &mode) override;
- CODE setRadioNetworkMode(RADIO_NETWORK_MODE mode) override;
CODE getSupportedCellularModes(CELLULAR_MODES &networks) override;
CODE getCellularMode(CELLULAR_MODES &networks) override;
diff --git a/src/MTS_IO_QuectelRadio.cpp b/src/MTS_IO_QuectelRadio.cpp
index 4c65382..c4bdc56 100644
--- a/src/MTS_IO_QuectelRadio.cpp
+++ b/src/MTS_IO_QuectelRadio.cpp
@@ -568,45 +568,3 @@ ICellularRadio::CODE QuectelRadio::convertToActiveBand(const std::string& sQuect
return SUCCESS;
}
-
-ICellularRadio::CODE QuectelRadio::getRadioNetworkMode(RADIO_NETWORK_MODE &mode)
-{
- // AT+QCFG="nwscanmode" execution can take up to 300ms according to the datasheet. Setting timeout to 500ms just for sure.
- std::string sCmd("AT+QCFG=\"nwscanmode\"");
- std::string cmdResult = sendCommand(sCmd, DEFAULT_BAIL_STRINGS, 500);
-
- if (cmdResult.find(ICellularRadio::RSP_OK) == std::string::npos) {
- printDebug("%s| AT+QCFG? returned unexpected response: [%s][%s]", getName().c_str(), sCmd.c_str(), cmdResult.c_str());
- return FAILURE;
- }
- switch (stoi(MTS::Text::split(cmdResult, ',')[1])) {
- case 1: mode = ICellularRadio::RADIO_NETWORK_MODE_GSM_ONLY; break;
- case 5: mode = ICellularRadio::RADIO_NETWORK_MODE_UMTS_ONLY; break;
- case 0: mode = ICellularRadio::RADIO_NETWORK_MODE_AUTO; break;
- default: mode = ICellularRadio::RADIO_NETWORK_MODE_UNKNOWN; break;
- }
- return SUCCESS;
-}
-
-ICellularRadio::CODE QuectelRadio::setRadioNetworkMode(RADIO_NETWORK_MODE mode)
-{
- std::string value;
- switch (mode) {
- case ICellularRadio::RADIO_NETWORK_MODE_GSM_ONLY: value = "1"; break;
- case ICellularRadio::RADIO_NETWORK_MODE_UMTS_ONLY: value = "5"; break;
- case ICellularRadio::RADIO_NETWORK_MODE_AUTO: value = "0"; break;
- default: return FAILURE;
- }
- std::string sCmd("AT+QCFG=\"nwscanmode\",");
- sCmd += value;
-
- // AT+QCFG="nwscanmode" execution can take up to 300ms according to the datasheet. Setting timeout to 500ms just for sure.
- std::string cmdResult = sendCommand(sCmd, DEFAULT_BAIL_STRINGS, 500);
-
- if (cmdResult.find(ICellularRadio::RSP_OK) == std::string::npos) {
- printDebug("%s| AT+QCFG? 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 b20d776..c04b47a 100644
--- a/src/MTS_IO_TelitRadio.cpp
+++ b/src/MTS_IO_TelitRadio.cpp
@@ -538,43 +538,6 @@ bool TelitRadio::getHardwareVersionFromFirmware(const std::string& sFirmware, st
}
-ICellularRadio::CODE TelitRadio::getRadioNetworkMode(RADIO_NETWORK_MODE &mode)
-{
- 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());
- return FAILURE;
- }
- // TODO: replace with MTS::Text::parse
- switch (stoi(MTS::Text::split(cmdResult, ':')[1])) {
- case 12: mode = ICellularRadio::RADIO_NETWORK_MODE_GSM_ONLY; break;
- case 22: mode = ICellularRadio::RADIO_NETWORK_MODE_UMTS_ONLY; break;
- case 25: mode = ICellularRadio::RADIO_NETWORK_MODE_AUTO; break;
- default: mode = ICellularRadio::RADIO_NETWORK_MODE_UNKNOWN; break;
- }
- return SUCCESS;
-}
-
-ICellularRadio::CODE TelitRadio::setRadioNetworkMode(RADIO_NETWORK_MODE mode)
-{
- std::string value;
- switch (mode) {
- case ICellularRadio::RADIO_NETWORK_MODE_GSM_ONLY: value = "12"; break;
- case ICellularRadio::RADIO_NETWORK_MODE_UMTS_ONLY: value = "22"; break;
- case ICellularRadio::RADIO_NETWORK_MODE_AUTO: value = "25"; break;
- default: return FAILURE;
- }
- std::string sCmd("AT+WS46=");
- sCmd += value;
- 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());
- return FAILURE;
- }
- return SUCCESS;
-}
-
ICellularRadio::CODE TelitRadio::getIsSimInserted(bool& bData) {
printTrace("%s| Get SIM insertion status", getName().c_str());
std::string sCmd("AT#SIMDET?");