diff options
author | Serhii Kostiuk <serhii.o.kostiuk@globallogic.com> | 2019-06-24 11:40:17 +0300 |
---|---|---|
committer | Serhii Kostiuk <serhii.o.kostiuk@globallogic.com> | 2019-06-24 11:40:17 +0300 |
commit | 961921f9fc73ed469d7f2d77c8ae681402dcf2ea (patch) | |
tree | 2148341296216869b3e3b0553b478d7c5ecc5cb4 | |
parent | ba09313666f3139be6c468c583ecc68da3ac2390 (diff) | |
parent | a9f2d8dbd9c02ef260a1a49ee3fa4aa599943df9 (diff) | |
download | radio-cmd-961921f9fc73ed469d7f2d77c8ae681402dcf2ea.tar.gz radio-cmd-961921f9fc73ed469d7f2d77c8ae681402dcf2ea.tar.bz2 radio-cmd-961921f9fc73ed469d7f2d77c8ae681402dcf2ea.zip |
Merge branch 'mtr-mtq-sim-status' into quectel-radio
-rw-r--r-- | main.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -67,6 +67,7 @@ std::string g_sActiveFirmware; std::string g_sConfigFile; Json::Value g_jData; std::string g_sRadioMode; +std::string g_sSimPin; MTS::AutoPtr<MTS::IO::ICellularRadio> g_apRadio; @@ -105,6 +106,7 @@ 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; void handle_sigterm(int signum); void printHelp(const std::string& sApp); @@ -144,6 +146,7 @@ static struct option long_options[] = { { "set-mip-mn-ha-ss", required_argument, 0, '9' }, { "get-radio-mode", no_argument, &iOption, OPT_GET_RADIOMODE }, { "set-radio-mode", required_argument, 0, OPT_SET_RADIOMODE }, + { "unlock-sim-card", required_argument, 0, OPT_UNLOCK_SIM_CARD }, { "init-dc", no_argument, &iOption, OPT_INIT_DC }, { "init-fumo", no_argument, &iOption, OPT_INIT_FUMO }, { "init-prl", no_argument, &iOption, OPT_INIT_PRL }, @@ -373,6 +376,11 @@ int main(int argc, char** argv) { } else if(g_iOptions & OPT_SET_RADIOMODE) { ICellularRadio::CODE res = g_apRadio->setRadioMode(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; + result = g_apRadio->unlockSimCard(jArgs); + printf("%s\n", code2str(result)); } shutdown(); @@ -586,6 +594,13 @@ void parseOptions(int argc, char** argv) g_iOptions |= OPT_SET_RADIOMODE; break; + case OPT_UNLOCK_SIM_CARD: + if(optarg != 0) { + g_sSimPin = optarg; + } + g_iOptions |= OPT_UNLOCK_SIM_CARD; + break; + default: printf("OPTION: [%d] ABORTING!!\n", c); abort(); @@ -635,6 +650,7 @@ void printHelp(const std::string& sApp) { // Applicable for LTE910-NA1 dual FW images only // printf("\t--set-active-firmware <VAL> : switch to a specific firmware image\n"); printf("\t--factory-default [ --msl <MSL> ] : reset to factory defaults\n"); + printf("\t--unlock-sim-card <SIM PIN> : unlock the SIM card using the PIN code provided\n"); printf("\n"); printf("\t--printlvl (p) <level> : sets the printlvl [0-100]\n"); printf("\t--version (v) : returns version\n"); |