From e840117fd382ecf6081dacf325d217a91d6bc471 Mon Sep 17 00:00:00 2001 From: Andrii Davydenko Date: Wed, 2 Nov 2022 16:36:16 +0200 Subject: [MTX-4694][GP-1791] MTCAP3 mPower R.6.1.X: LNA7D support - APN setup behavior when provider is Verizon Add set-pdp-conf-static parameter to set the PDP context Add ctx-id parameter to specify ID of the PDP context to modify Add apn parameter to specify APN string that would write to the PDP context Add ipMode parameter to specify IP Mode that would write to the PDP context --- main.cpp | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 59023c6..ffd4535 100644 --- a/main.cpp +++ b/main.cpp @@ -71,6 +71,8 @@ std::string g_sSimPin; std::string g_sCellularMode; std::string g_sDeltaFwPath; std::string g_sUeModeOfOperation; +std::string g_sPdpId; +Json::Value g_jPdpConfig; MTS::AutoPtr g_apRadio; @@ -117,6 +119,7 @@ const uint32_t AOPT_DFU_APPLY = 0x00000004; const uint32_t AOPT_FUMO_LOCAL = 0x00000008; const uint32_t AOPT_SET_UE_MODE_OF_OPERATION = 0x00000010; const uint32_t AOPT_DISABLE_VOICE_SUPPORT = 0x00000020; +const uint32_t AOPT_SET_PDP_CONF_STATIC = 0x00000040; void handle_sigterm(int signum); void printHelp(const std::string& sApp); @@ -166,6 +169,10 @@ static struct option long_options[] = { { "init-fumo-local", required_argument, 0, 'F' }, { "set-ue-mode-of-operation",required_argument, 0, 'U' }, { "disable-voice-support", no_argument, 0, 'V' }, + { "set-pdp-conf-static", no_argument, 0, 'P' }, + { "ctx-id", required_argument, 0, 'C' }, + { "apn", required_argument, 0, 'a' }, + { "ipMode", required_argument, 0, 'i' }, { 0, 0, 0, 0 } }; @@ -419,6 +426,9 @@ int main(int argc, char** argv) { } else if (g_iAuxOptions & AOPT_DISABLE_VOICE_SUPPORT) { result = g_apRadio->disableVoiceSupport(); printf("%s\n", code2str(result)); + } else if (g_iAuxOptions & AOPT_SET_PDP_CONF_STATIC) { + result = g_apRadio->setPdpContext(g_sPdpId, g_jPdpConfig); + printf("%s\n", code2str(result)); } shutdown(); @@ -447,7 +457,7 @@ void parseOptions(int argc, char** argv) } while (true) { - int c = getopt_long(argc, argv, "t:d:p:r:?v", long_options, nullptr); + int c = getopt_long(argc, argv, "t:d:p:r:?vC:", long_options, nullptr); /* Detect the end of the options. */ if(c == -1) { @@ -662,6 +672,28 @@ void parseOptions(int argc, char** argv) g_iAuxOptions |= AOPT_DISABLE_VOICE_SUPPORT; break; + case 'P': + g_iAuxOptions |= AOPT_SET_PDP_CONF_STATIC; + break; + + case 'C': + if(optarg != 0) { + g_sPdpId = optarg; + } + break; + + case 'a': + if(optarg != 0) { + g_jPdpConfig[MTS::IO::ICellularRadio::KEY_PDP_CONTEXT_APN] = optarg; + } + break; + + case 'i': + if(optarg != 0) { + g_jPdpConfig[MTS::IO::ICellularRadio::KEY_PDP_CONTEXT_IPMODE] = optarg; + } + break; + default: printf("OPTION: [%d] ABORTING!!\n", c); abort(); @@ -716,6 +748,10 @@ void printHelp(const std::string& sApp) { printf("\t--reset-radio : reset the radio module using AT commands\n"); printf("\t--start-oma-dm : start the OMA DM procedure (selected radios and networks only)\n"); printf("\t--init-fumo-local : perform the radio firmware upgrade using the provided image file\n"); + printf("\t--set-pdp-conf-static : set the specified PDP context\n"); + printf("\t --ctx-id : specify a Context ID for the set-pdp-conf-static command\n"); + printf("\t --apn : specify an APN for the set-pdp-conf-static command\n"); + printf("\t --ipMode : specify an IP Mode for the set-pdp-conf-static command\n"); // Undocumented: use for debugging and testing purposes // printf("\t--delta-fwu-upload : upload a delta radio FWU file to the radio\n"); // printf("\t--delta-fwu-apply : apply the delta radio FWU image that was already uploaded to the radio\n"); -- cgit v1.2.3