summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Hatch <jhatch@multitech.com>2022-11-07 14:59:35 -0600
committerJeff Hatch <jhatch@multitech.com>2022-11-07 14:59:35 -0600
commit136b8cbb9fd3235f9b5e17dab792700af252820f (patch)
tree592fb73d6dd46c2b795ba5a1a1bbc5c264c9f3e4
parent2879cadacb31a65679aa5bdeac7369e65ea47daf (diff)
parentc0aa5515a92c0c62dd74e07e23199ad37182e5f1 (diff)
downloadradio-query-136b8cbb9fd3235f9b5e17dab792700af252820f.tar.gz
radio-query-136b8cbb9fd3235f9b5e17dab792700af252820f.tar.bz2
radio-query-136b8cbb9fd3235f9b5e17dab792700af252820f.zip
Merge branch 'ad/MTX-4694/apn-setup-behavior-for-vzw' into 'master'
[MTX-4694][GP-1791] MTCAP3 mPower R.6.1.X: LNA7D support - APN setup behavior wh… See merge request !16
-rw-r--r--main.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/main.cpp b/main.cpp
index f2cc086..8a763cf 100644
--- a/main.cpp
+++ b/main.cpp
@@ -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");