diff options
author | Andrii Davydenko <andrii.davydenko@globallogic.com> | 2022-11-02 16:37:31 +0200 |
---|---|---|
committer | Andrii Davydenko <andrii.davydenko@globallogic.com> | 2022-11-07 12:39:32 +0200 |
commit | c0aa5515a92c0c62dd74e07e23199ad37182e5f1 (patch) | |
tree | 592fb73d6dd46c2b795ba5a1a1bbc5c264c9f3e4 | |
parent | 2879cadacb31a65679aa5bdeac7369e65ea47daf (diff) | |
download | radio-query-c0aa5515a92c0c62dd74e07e23199ad37182e5f1.tar.gz radio-query-c0aa5515a92c0c62dd74e07e23199ad37182e5f1.tar.bz2 radio-query-c0aa5515a92c0c62dd74e07e23199ad37182e5f1.zip |
[MTX-4694][GP-1791] MTCAP3 mPower R.6.1.X: LNA7D support - APN setup behavior when provider is Verizon
Add pdp-conf-static parameter to get the PDP context
Add ctx-id parameter to choose the PDP context to print
-rw-r--r-- | main.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
@@ -58,6 +58,7 @@ std::string g_sModel; std::string g_sType; std::string g_sPort(DEFAULT_PORT); Json::Value g_jData; +std::string g_sPdpContextId; MTS::AutoPtr<MTS::IO::ICellularRadio> g_apRadio; @@ -101,6 +102,7 @@ const uint32_t OPT_SELECTED_BANDS_RAW = 0x20000000; int32_t g_iAuxOptions = 0; const uint32_t AOPT_VOICE_SUPPORT = 0x00000001; +const uint32_t AOPT_PDP_CONF_STATIC = 0x00000002; void handle_sigterm(int signum); void printHelp(const std::string& sApp); @@ -376,6 +378,20 @@ int main(int argc, char** argv) { if (result == ICellularRadio::SUCCESS) { printf("%s", sResult.c_str()); } + } else if (g_iAuxOptions & AOPT_PDP_CONF_STATIC) { + Json::Value jValue; + result = g_apRadio->getPdpContexts(jValue); + if (result == ICellularRadio::SUCCESS) { + if (g_sPdpContextId.empty()) { + printf("%s", toCompactStyledString(jValue).c_str()); + } else { + if (jValue.isMember(g_sPdpContextId)) { + printf("%s", toCompactStyledString(jValue[g_sPdpContextId]).c_str()); + } else { + result = ICellularRadio::CODE::FAILURE; + } + } + } } if (g_bIstty && result == ICellularRadio::CODE::SUCCESS) @@ -670,12 +686,14 @@ void parseOptions(int argc, char** argv) { { "sim-mcc-mnc", no_argument, &iOption, OPT_SIM_MCC_MNC }, { "voice-support",no_argument, &iAuxOption, AOPT_VOICE_SUPPORT }, { "selected-bands-raw", no_argument, &iOption, OPT_SELECTED_BANDS_RAW }, + { "pdp-conf-static", no_argument, &iAuxOption, AOPT_PDP_CONF_STATIC }, + { "ctx-id", required_argument, 0, 'C' }, { 0, 0, 0, 0 } }; /* getopt_long stores the option index here. */ int option_index = 0; - c = getopt_long(argc, argv, "d:p:ic:?v", long_options, &option_index); + c = getopt_long(argc, argv, "d:p:ic:?vC:", long_options, &option_index); /* Detect the end of the options. */ if (c == -1) { @@ -729,6 +747,12 @@ void parseOptions(int argc, char** argv) { } break; + case 'C': + if(optarg != 0) { + g_sPdpContextId = optarg; + } + break; + default: printf("OPTION: [%d] ABORTING!!\n", c); abort(); @@ -785,6 +809,7 @@ void printHelp(const std::string& sApp) { printf("\t--sim-mcc-mnc\n"); printf("\t--voice-support\n"); printf("\t--selected-bands-raw\n"); + printf("\t--pdp-conf-static --ctx-id <context-id>\n"); // Applicable for LTE910-NA1 dual FW images only // printf("\t--active-firmware\n"); printf("\n"); |