summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksym Telychko <maksym.telychko@globallogic.com>2019-07-31 14:52:55 +0300
committerMaksym Telychko <maksym.telychko@globallogic.com>2019-07-31 14:52:55 +0300
commit2dcf326dc4c3094ffd65d3c6da2113312761054b (patch)
tree720b1c509186c73d3de79b0b2ebb900d2e0187c3
parentba6621b8bbe21c6dbef290cffd4a816970b2b079 (diff)
downloadradio-cmd-2dcf326dc4c3094ffd65d3c6da2113312761054b.tar.gz
radio-cmd-2dcf326dc4c3094ffd65d3c6da2113312761054b.tar.bz2
radio-cmd-2dcf326dc4c3094ffd65d3c6da2113312761054b.zip
MTX-2891 mpower 2-3-4g switch: removed obsolete parameters
Use set-cellular-mode and 'radio-query --get-cellular-mode' instead Reverted commits: ba09313666f3139be6c468c583ecc68da3ac2390 [MTS-MTQ] updated help for new option 425d8bf72dd3d43896da1aa9374c137b69d89c0f [MTS-MTQ] added set-radio-mode/get-radio-mode options
-rw-r--r--main.cpp47
1 files changed, 0 insertions, 47 deletions
diff --git a/main.cpp b/main.cpp
index a30335a..d65204d 100644
--- a/main.cpp
+++ b/main.cpp
@@ -66,7 +66,6 @@ std::string g_sRxDiversity;
std::string g_sActiveFirmware;
std::string g_sConfigFile;
Json::Value g_jData;
-std::string g_sRadioMode;
std::string g_sSimPin;
std::string g_sCellularMode;
@@ -105,8 +104,6 @@ const uint32_t OPT_MSID = 0x00800000;
const uint32_t OPT_SETRXDIVERSITY = 0x01000000;
const uint32_t OPT_SETACTIVEFIRMWARE = 0x02000000;
const uint32_t OPT_CONFIG_FILE = 0x04000000;
-const uint32_t OPT_GET_RADIOMODE = 0x08000000;
-const uint32_t OPT_SET_RADIOMODE = 0x10000000;
const uint32_t OPT_UNLOCK_SIM_CARD = 0x20000000;
const uint32_t OPT_RESET_RADIO = 0x40000000;
@@ -120,8 +117,6 @@ void initializeCache();
void shutdown();
const char *code2str(MTS::IO::ICellularRadio::CODE code);
std::string loadImeiFromDeviceInfo();
-MTS::IO::ICellularRadio::RADIO_NETWORK_MODE radioModeEnum(const std::string &mode);
-const char* radioModeStr(MTS::IO::ICellularRadio::RADIO_NETWORK_MODE mode);
MTS::IO::ICellularRadio::CELLULAR_MODES cellularModeFlags(const std::string networks);
@@ -151,8 +146,6 @@ static struct option long_options[] = {
{ "set-mip-mn-aaa-ss", required_argument, 0, '8' },
{ "set-mip-mn-ha-ss", required_argument, 0, '9' },
{ "unlock-sim-card", required_argument, 0, OPT_UNLOCK_SIM_CARD },
- { "get-radio-network-mode", no_argument, &iOption, OPT_GET_RADIOMODE },
- { "set-radio-network-mode", required_argument, 0, OPT_SET_RADIOMODE },
{ "reset-radio", no_argument, &iOption, OPT_RESET_RADIO },
{ "init-dc", no_argument, &iOption, OPT_INIT_DC },
{ "init-fumo", no_argument, &iOption, OPT_INIT_FUMO },
@@ -377,13 +370,6 @@ int main(int argc, char** argv) {
jArgs["fwid"] = g_sActiveFirmware;
result = g_apRadio->setActiveFirmware(jArgs);
printf("%s\n", code2str(result));
- } else if(g_iOptions & OPT_GET_RADIOMODE) {
- ICellularRadio::RADIO_NETWORK_MODE mode;
- g_apRadio->getRadioNetworkMode(mode);
- printf("%s\n", radioModeStr(mode));
- } else if(g_iOptions & OPT_SET_RADIOMODE) {
- ICellularRadio::CODE res = g_apRadio->setRadioNetworkMode(radioModeEnum(g_sRadioMode));
- printf("%s\n", code2str(res));
} else if(g_iOptions & OPT_UNLOCK_SIM_CARD) {
Json::Value jArgs(Json::objectValue);
jArgs["pin"] = g_sSimPin;
@@ -608,12 +594,6 @@ void parseOptions(int argc, char** argv)
g_iOptions |= OPT_SETMIPMNHASS;
break;
- case OPT_SET_RADIOMODE:
- if (optarg)
- g_sRadioMode = optarg;
- g_iOptions |= OPT_SET_RADIOMODE;
- break;
-
case OPT_UNLOCK_SIM_CARD:
if(optarg != 0) {
g_sSimPin = optarg;
@@ -671,8 +651,6 @@ void printHelp(const std::string& sApp) {
printf("\t--set-mip-mn-aaa-ss <VAL> : set MIP MN AAA SS\n");
printf("\t--set-mip-mn-ha-ss <VAL> : set MIP MN HA SS\n");
printf("\t--set-rx-diversity <VAL> : set RX Diversity\n");
- printf("\t--get-radio-network-mode : get selected cellular network\n");
- printf("\t--set-radio-network-mode {auto|gsm|umts} : set cellular network\n");
printf("\t--set-cellular-mode : set preferred networks eg. 2g,3g,4g\n");
// Applicable for LTE910-NA1 dual FW images only
// printf("\t--set-active-firmware <VAL> : switch to a specific firmware image\n");
@@ -706,31 +684,6 @@ const char *code2str(MTS::IO::ICellularRadio::CODE code) {
return "Unknown";
}
-MTS::IO::ICellularRadio::RADIO_NETWORK_MODE radioModeEnum(const std::string &mode)
-{
- using namespace MTS::IO;
- if (mode == "auto")
- return ICellularRadio::RADIO_NETWORK_MODE_AUTO;
- else if (mode == "gsm")
- return ICellularRadio::RADIO_NETWORK_MODE_GSM_ONLY;
- else if (mode == "umts")
- return ICellularRadio::RADIO_NETWORK_MODE_UMTS_ONLY;
- else
- return ICellularRadio::RADIO_NETWORK_MODE_UNKNOWN;
-
-}
-
-const char* radioModeStr(MTS::IO::ICellularRadio::RADIO_NETWORK_MODE mode)
-{
- using namespace MTS::IO;
- switch (mode) {
- case ICellularRadio::RADIO_NETWORK_MODE_GSM_ONLY : return "gsm";
- case ICellularRadio::RADIO_NETWORK_MODE_UMTS_ONLY: return "umts";
- case ICellularRadio::RADIO_NETWORK_MODE_AUTO : return "auto";
- default : return "";
- }
-}
-
MTS::IO::ICellularRadio::CELLULAR_MODES cellularModeFlags(const std::string networks)
{
using namespace MTS::IO;