summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.cpp38
1 files changed, 37 insertions, 1 deletions
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<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");