From 1a000857bb7eef298efa787699050884f92311fe Mon Sep 17 00:00:00 2001 From: Jaime Lopez Date: Wed, 21 Jul 2010 18:03:58 -0700 Subject: qemu: Multimode support Preliminary implementation of a Multimode modem - Added the +CTEC AT command which allows querying and setting the current technology - Added preliminary NVRAM file support Add cdma subscription source support - Add support to save the subscription source preference to nv. - Add command 'cdma ssource' to switch subscription source from the emulator console Implement AT+WRMP command Implement the AT+WRMP command to set and get the roaming preference Implement Emergency Callback Mode Implement the +WSOS command and unsol to notify Emergency Callback Mode status Implement +WPRL AT Command Enable PRL update notification by implementing the AT+WPRL query command Implement a console command to send +WPRL unsolicited response Change-Id: I5c036c1b0832b94c0b7675931f6a18b5d9ca7436 --- android/console.c | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) (limited to 'android/console.c') diff --git a/android/console.c b/android/console.c index d341d71..c47768e 100644 --- a/android/console.c +++ b/android/console.c @@ -972,6 +972,85 @@ static const CommandDefRec redir_commands[] = /********************************************************************************************/ /********************************************************************************************/ /***** ******/ +/***** C D M A M O D E M ******/ +/***** ******/ +/********************************************************************************************/ +/********************************************************************************************/ + +static const struct { + const char * name; + const char * display; + ACdmaSubscriptionSource source; +} _cdma_subscription_sources[] = { + { "nv", "Read subscription from non-volatile RAM", A_SUBSCRIPTION_NVRAM }, + { "ruim", "Read subscription from RUIM", A_SUBSCRIPTION_RUIM }, +}; + +static void +dump_subscription_sources( ControlClient client ) +{ + int i; + for (i = 0; + i < sizeof(_cdma_subscription_sources) / sizeof(_cdma_subscription_sources[0]); + i++) { + control_write( client, " %s: %s\r\n", + _cdma_subscription_sources[i].name, + _cdma_subscription_sources[i].display ); + } +} + +static void +describe_subscription_source( ControlClient client ) +{ + control_write( client, + "'cdma ssource ' allows you to specify where to read the subscription from\r\n" ); + dump_subscription_sources( client ); +} + +static int +do_cdma_ssource( ControlClient client, char* args ) +{ + int nn; + if (!args) { + control_write( client, "KO: missing argument, try 'cdma ssource '\r\n" ); + return -1; + } + + for (nn = 0; ; nn++) { + const char* name = _cdma_subscription_sources[nn].name; + ACdmaSubscriptionSource ssource = _cdma_subscription_sources[nn].source; + + if (!name) + break; + + if (!strcasecmp( args, name )) { + amodem_set_cdma_subscription_source( android_modem, ssource ); + return 0; + } + } + control_write( client, "KO: Don't know source %s\r\n", args ); + return -1; +} + +static int +do_cdma_prl_version( ControlClient client, char * args ) +{ + int version = 0; + char *endptr; + + if (!args) { + control_write( client, "KO: missing argument, try 'cdma prl_version '\r\n"); + return -1; + } + + version = strtol(args, &endptr, 0); + if (endptr != args) { + amodem_set_cdma_prl_version( android_modem, version ); + } +} +/********************************************************************************************/ +/********************************************************************************************/ +/***** ******/ /***** G S M M O D E M ******/ /***** ******/ /********************************************************************************************/ @@ -1314,6 +1393,13 @@ static const CommandDefRec gsm_in_commands[] = #endif +static const CommandDefRec cdma_commands[] = +{ + { "ssource", "Set the current CDMA subscription source", + NULL, describe_subscription_source, + do_cdma_ssource, NULL }, +}; + static const CommandDefRec gsm_commands[] = { { "list", "list current phone calls", @@ -2194,6 +2280,10 @@ static const CommandDefRec main_commands[] = "allows you to change GSM-related settings, or to make a new inbound phone call\r\n", NULL, NULL, gsm_commands }, + { "cdma", "CDMA related commands", + "allows you to change CDMA-related settings\r\n", NULL, + NULL, cdma_commands }, + { "kill", "kill the emulator instance", NULL, NULL, do_kill, NULL }, -- cgit v1.1