diff options
author | Jeff Hatch <jhatch@multitech.com> | 2022-11-07 15:01:06 -0600 |
---|---|---|
committer | Jeff Hatch <jhatch@multitech.com> | 2022-11-07 15:01:06 -0600 |
commit | be3d7152ede929187c9a022c6d4fea33d9b61719 (patch) | |
tree | df3029b7bc97014424710055c9758c73f4884e6b | |
parent | f354088944ec65e5faf6755b867b9140cabe616f (diff) | |
parent | e840117fd382ecf6081dacf325d217a91d6bc471 (diff) | |
download | radio-cmd-be3d7152ede929187c9a022c6d4fea33d9b61719.tar.gz radio-cmd-be3d7152ede929187c9a022c6d4fea33d9b61719.tar.bz2 radio-cmd-be3d7152ede929187c9a022c6d4fea33d9b61719.zip |
Merge branch 'ad/MTX-4694/apn-setup-behavior-for-vzw' into 'master'
1.0.1
[MTX-4694][GP-1791] MTCAP3 mPower R.6.1.X: LNA7D support - APN setup behavior wh…
See merge request !11
-rw-r--r-- | main.cpp | 38 |
1 files changed, 37 insertions, 1 deletions
@@ -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<MTS::IO::ICellularRadio> 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 <FILE_PATH> : 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 <ID> : specify a Context ID for the set-pdp-conf-static command\n"); + printf("\t --apn <APN> : specify an APN for the set-pdp-conf-static command\n"); + printf("\t --ipMode <MODE> : specify an IP Mode for the set-pdp-conf-static command\n"); // Undocumented: use for debugging and testing purposes // printf("\t--delta-fwu-upload <FILE_PATH> : 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"); |