Home | History | Annotate | Download | only in telephony
      1 /*
      2  * Copyright (C) 2006 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17  /* ISSUES:
     18  * - SMS retransmit (specifying TP-Message-ID)
     19  *
     20  */
     21 
     22 /**
     23  * TODO
     24  *
     25  * Supp Service Notification (+CSSN)
     26  * GPRS PDP context deactivate notification
     27  *
     28  */
     29 
     30 
     31 #ifndef ANDROID_RIL_H
     32 #define ANDROID_RIL_H 1
     33 
     34 #include <stdlib.h>
     35 #ifndef FEATURE_UNIT_TEST
     36 #include <sys/time.h>
     37 #endif /* !FEATURE_UNIT_TEST */
     38 
     39 #ifdef __cplusplus
     40 extern "C" {
     41 #endif
     42 
     43 #define RIL_VERSION 4
     44 
     45 #define CDMA_ALPHA_INFO_BUFFER_LENGTH 64
     46 #define CDMA_NUMBER_INFO_BUFFER_LENGTH 81
     47 
     48 typedef void * RIL_Token;
     49 
     50 typedef enum {
     51     RIL_E_SUCCESS = 0,
     52     RIL_E_RADIO_NOT_AVAILABLE = 1,     /* If radio did not start or is resetting */
     53     RIL_E_GENERIC_FAILURE = 2,
     54     RIL_E_PASSWORD_INCORRECT = 3,      /* for PIN/PIN2 methods only! */
     55     RIL_E_SIM_PIN2 = 4,                /* Operation requires SIM PIN2 to be entered */
     56     RIL_E_SIM_PUK2 = 5,                /* Operation requires SIM PIN2 to be entered */
     57     RIL_E_REQUEST_NOT_SUPPORTED = 6,
     58     RIL_E_CANCELLED = 7,
     59     RIL_E_OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, /* data ops are not allowed during voice
     60                                                    call on a Class C GPRS device */
     61     RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9,  /* data ops are not allowed before device
     62                                                    registers in network */
     63     RIL_E_SMS_SEND_FAIL_RETRY = 10,             /* fail to send sms and need retry */
     64     RIL_E_SIM_ABSENT = 11,                      /* fail to set the location where CDMA subscription
     65                                                    shall be retrieved because of SIM or RUIM
     66                                                    card absent */
     67     RIL_E_SUBSCRIPTION_NOT_AVAILABLE = 12,      /* fail to find CDMA subscription from specified
     68                                                    location */
     69     RIL_E_MODE_NOT_SUPPORTED = 13,              /* HW does not support preferred network type */
     70     RIL_E_FDN_CHECK_FAILURE = 14,               /* command failed because recipient is not on FDN list */
     71     RIL_E_ILLEGAL_SIM_OR_ME = 15                /* network selection failed due to
     72                                                    illegal SIM or ME */
     73 } RIL_Errno;
     74 
     75 typedef enum {
     76     RIL_CALL_ACTIVE = 0,
     77     RIL_CALL_HOLDING = 1,
     78     RIL_CALL_DIALING = 2,    /* MO call only */
     79     RIL_CALL_ALERTING = 3,   /* MO call only */
     80     RIL_CALL_INCOMING = 4,   /* MT call only */
     81     RIL_CALL_WAITING = 5     /* MT call only */
     82 } RIL_CallState;
     83 
     84 typedef enum {
     85     RADIO_STATE_OFF = 0,                   /* Radio explictly powered off (eg CFUN=0) */
     86     RADIO_STATE_UNAVAILABLE = 1,           /* Radio unavailable (eg, resetting or not booted) */
     87     RADIO_STATE_SIM_NOT_READY = 2,         /* Radio is on, but the SIM interface is not ready */
     88     RADIO_STATE_SIM_LOCKED_OR_ABSENT = 3,  /* SIM PIN locked, PUK required, network
     89                                               personalization locked, or SIM absent */
     90     RADIO_STATE_SIM_READY = 4,             /* Radio is on and SIM interface is available */
     91     RADIO_STATE_RUIM_NOT_READY = 5,        /* Radio is on, but the RUIM interface is not ready */
     92     RADIO_STATE_RUIM_READY = 6,            /* Radio is on and the RUIM interface is available */
     93     RADIO_STATE_RUIM_LOCKED_OR_ABSENT = 7, /* RUIM PIN locked, PUK required, network
     94                                               personalization locked, or RUIM absent */
     95     RADIO_STATE_NV_NOT_READY = 8,          /* Radio is on, but the NV interface is not available */
     96     RADIO_STATE_NV_READY = 9               /* Radio is on and the NV interface is available */
     97 } RIL_RadioState;
     98 
     99 /* User-to-User signaling Info activation types derived from 3GPP 23.087 v8.0 */
    100 typedef enum {
    101     RIL_UUS_TYPE1_IMPLICIT = 0,
    102     RIL_UUS_TYPE1_REQUIRED = 1,
    103     RIL_UUS_TYPE1_NOT_REQUIRED = 2,
    104     RIL_UUS_TYPE2_REQUIRED = 3,
    105     RIL_UUS_TYPE2_NOT_REQUIRED = 4,
    106     RIL_UUS_TYPE3_REQUIRED = 5,
    107     RIL_UUS_TYPE3_NOT_REQUIRED = 6
    108 } RIL_UUS_Type;
    109 
    110 /* User-to-User Signaling Information data coding schemes. Possible values for
    111  * Octet 3 (Protocol Discriminator field) in the UUIE. The values have been
    112  * specified in section 10.5.4.25 of 3GPP TS 24.008 */
    113 typedef enum {
    114     RIL_UUS_DCS_USP = 0,          /* User specified protocol */
    115     RIL_UUS_DCS_OSIHLP = 1,       /* OSI higher layer protocol */
    116     RIL_UUS_DCS_X244 = 2,         /* X.244 */
    117     RIL_UUS_DCS_RMCF = 3,         /* Reserved for system mangement
    118                                      convergence function */
    119     RIL_UUS_DCS_IA5c = 4          /* IA5 characters */
    120 } RIL_UUS_DCS;
    121 
    122 /* User-to-User Signaling Information defined in 3GPP 23.087 v8.0
    123  * This data is passed in RIL_ExtensionRecord and rec contains this
    124  * structure when type is RIL_UUS_INFO_EXT_REC */
    125 typedef struct {
    126   RIL_UUS_Type    uusType;    /* UUS Type */
    127   RIL_UUS_DCS     uusDcs;     /* UUS Data Coding Scheme */
    128   int             uusLength;  /* Length of UUS Data */
    129   char *          uusData;    /* UUS Data */
    130 } RIL_UUS_Info;
    131 
    132 /* CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */
    133 typedef struct {
    134   char isPresent;    /* non-zero if signal information record is present */
    135   char signalType;   /* as defined 3.7.5.5-1 */
    136   char alertPitch;   /* as defined 3.7.5.5-2 */
    137   char signal;       /* as defined 3.7.5.5-3, 3.7.5.5-4 or 3.7.5.5-5 */
    138 } RIL_CDMA_SignalInfoRecord;
    139 
    140 typedef struct {
    141     RIL_CallState   state;
    142     int             index;      /* Connection Index for use with, eg, AT+CHLD */
    143     int             toa;        /* type of address, eg 145 = intl */
    144     char            isMpty;     /* nonzero if is mpty call */
    145     char            isMT;       /* nonzero if call is mobile terminated */
    146     char            als;        /* ALS line indicator if available
    147                                    (0 = line 1) */
    148     char            isVoice;    /* nonzero if this is is a voice call */
    149     char            isVoicePrivacy;     /* nonzero if CDMA voice privacy mode is active */
    150     char *          number;     /* Remote party number */
    151     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
    152     char *          name;       /* Remote party name */
    153     int             namePresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
    154     RIL_UUS_Info *  uusInfo;    /* NULL or Pointer to User-User Signaling Information */
    155 } RIL_Call;
    156 
    157 typedef struct {
    158     int             cid;        /* Context ID */
    159     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
    160     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
    161                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". */
    162     char *          apn;
    163     char *          address;    /* The IPv4 or IPv6 address assigned to the call, e.g., "192.0.1.3"
    164                                    or "2001:db8::1". */
    165 } RIL_Data_Call_Response;
    166 
    167 typedef struct {
    168     int messageRef;   /* TP-Message-Reference for GSM,
    169                          and BearerData MessageId for CDMA
    170                          (See 3GPP2 C.S0015-B, v2.0, table 4.5-1). */
    171     char *ackPDU;     /* or NULL if n/a */
    172     int errorCode;    /* See 3GPP 27.005, 3.2.5 for GSM/UMTS,
    173                          3GPP2 N.S0005 (IS-41C) Table 171 for CDMA,
    174                          -1 if unknown or not applicable*/
    175 } RIL_SMS_Response;
    176 
    177 /** Used by RIL_REQUEST_WRITE_SMS_TO_SIM */
    178 typedef struct {
    179     int status;     /* Status of message.  See TS 27.005 3.1, "<stat>": */
    180                     /*      0 = "REC UNREAD"    */
    181                     /*      1 = "REC READ"      */
    182                     /*      2 = "STO UNSENT"    */
    183                     /*      3 = "STO SENT"      */
    184     char * pdu;     /* PDU of message to write, as an ASCII hex string less the SMSC address,
    185                        the TP-layer length is "strlen(pdu)/2". */
    186     char * smsc;    /* SMSC address in GSM BCD format prefixed by a length byte
    187                        (as expected by TS 27.005) or NULL for default SMSC */
    188 } RIL_SMS_WriteArgs;
    189 
    190 /** Used by RIL_REQUEST_DIAL */
    191 typedef struct {
    192     char * address;
    193     int clir;
    194             /* (same as 'n' paremeter in TS 27.007 7.7 "+CLIR"
    195              * clir == 0 on "use subscription default value"
    196              * clir == 1 on "CLIR invocation" (restrict CLI presentation)
    197              * clir == 2 on "CLIR suppression" (allow CLI presentation)
    198              */
    199     RIL_UUS_Info *  uusInfo;    /* NULL or Pointer to User-User Signaling Information */
    200 } RIL_Dial;
    201 
    202 typedef struct {
    203     int command;    /* one of the commands listed for TS 27.007 +CRSM*/
    204     int fileid;     /* EF id */
    205     char *path;     /* "pathid" from TS 27.007 +CRSM command.
    206                        Path is in hex asciii format eg "7f205f70"
    207                        Path must always be provided.
    208                      */
    209     int p1;
    210     int p2;
    211     int p3;
    212     char *data;     /* May be NULL*/
    213     char *pin2;     /* May be NULL*/
    214 } RIL_SIM_IO;
    215 
    216 typedef struct {
    217     int sw1;
    218     int sw2;
    219     char *simResponse;  /* In hex string format ([a-fA-F0-9]*). */
    220 } RIL_SIM_IO_Response;
    221 
    222 /* See also com.android.internal.telephony.gsm.CallForwardInfo */
    223 
    224 typedef struct {
    225     int             status;     /*
    226                                  * For RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
    227                                  * status 1 = active, 0 = not active
    228                                  *
    229                                  * For RIL_REQUEST_SET_CALL_FORWARD:
    230                                  * status is:
    231                                  * 0 = disable
    232                                  * 1 = enable
    233                                  * 2 = interrogate
    234                                  * 3 = registeration
    235                                  * 4 = erasure
    236                                  */
    237 
    238     int             reason;      /* from TS 27.007 7.11 "reason" */
    239     int             serviceClass;/* From 27.007 +CCFC/+CLCK "class"
    240                                     See table for Android mapping from
    241                                     MMI service code
    242                                     0 means user doesn't input class */
    243     int             toa;         /* "type" from TS 27.007 7.11 */
    244     char *          number;      /* "number" from TS 27.007 7.11. May be NULL */
    245     int             timeSeconds; /* for CF no reply only */
    246 }RIL_CallForwardInfo;
    247 
    248 typedef struct {
    249    char * cid;         /* Combination of LAC and Cell Id in 32 bits in GSM.
    250                         * Upper 16 bits is LAC and lower 16 bits
    251                         * is CID (as described in TS 27.005)
    252                         * Primary Scrambling Code (as described in TS 25.331)
    253                         *         in 9 bits in UMTS
    254                         * Valid values are hexadecimal 0x0000 - 0xffffffff.
    255                         */
    256    int    rssi;        /* Received RSSI in GSM,
    257                         * Level index of CPICH Received Signal Code Power in UMTS
    258                         */
    259 } RIL_NeighboringCell;
    260 
    261 /* See RIL_REQUEST_LAST_CALL_FAIL_CAUSE */
    262 typedef enum {
    263     CALL_FAIL_UNOBTAINABLE_NUMBER = 1,
    264     CALL_FAIL_NORMAL = 16,
    265     CALL_FAIL_BUSY = 17,
    266     CALL_FAIL_CONGESTION = 34,
    267     CALL_FAIL_ACM_LIMIT_EXCEEDED = 68,
    268     CALL_FAIL_CALL_BARRED = 240,
    269     CALL_FAIL_FDN_BLOCKED = 241,
    270     CALL_FAIL_IMSI_UNKNOWN_IN_VLR = 242,
    271     CALL_FAIL_IMEI_NOT_ACCEPTED = 243,
    272     CALL_FAIL_CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000,
    273     CALL_FAIL_CDMA_DROP = 1001,
    274     CALL_FAIL_CDMA_INTERCEPT = 1002,
    275     CALL_FAIL_CDMA_REORDER = 1003,
    276     CALL_FAIL_CDMA_SO_REJECT = 1004,
    277     CALL_FAIL_CDMA_RETRY_ORDER = 1005,
    278     CALL_FAIL_CDMA_ACCESS_FAILURE = 1006,
    279     CALL_FAIL_CDMA_PREEMPTED = 1007,
    280     CALL_FAIL_CDMA_NOT_EMERGENCY = 1008, /* For non-emergency number dialed
    281                                             during emergency callback mode */
    282     CALL_FAIL_CDMA_ACCESS_BLOCKED = 1009, /* CDMA network access probes blocked */
    283     CALL_FAIL_ERROR_UNSPECIFIED = 0xffff
    284 } RIL_LastCallFailCause;
    285 
    286 /* See RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE */
    287 typedef enum {
    288     PDP_FAIL_OPERATOR_BARRED = 0x08,               /* no retry */
    289     PDP_FAIL_INSUFFICIENT_RESOURCES = 0x1A,
    290     PDP_FAIL_MISSING_UKNOWN_APN = 0x1B,            /* no retry */
    291     PDP_FAIL_UNKNOWN_PDP_ADDRESS_TYPE = 0x1C,      /* no retry */
    292     PDP_FAIL_USER_AUTHENTICATION = 0x1D,           /* no retry */
    293     PDP_FAIL_ACTIVATION_REJECT_GGSN = 0x1E,        /* no retry */
    294     PDP_FAIL_ACTIVATION_REJECT_UNSPECIFIED = 0x1F,
    295     PDP_FAIL_SERVICE_OPTION_NOT_SUPPORTED = 0x20,  /* no retry */
    296     PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED = 0x21, /* no retry */
    297     PDP_FAIL_SERVICE_OPTION_OUT_OF_ORDER = 0x22,
    298     PDP_FAIL_NSAPI_IN_USE      = 0x23,             /* no retry */
    299     PDP_FAIL_PROTOCOL_ERRORS   = 0x6F,             /* no retry */
    300     PDP_FAIL_ERROR_UNSPECIFIED = 0xffff,  /* This and all other cases: retry silently */
    301     /* Not mentioned in the specification */
    302     PDP_FAIL_REGISTRATION_FAIL = -1,
    303     PDP_FAIL_GPRS_REGISTRATION_FAIL = -2,
    304 } RIL_LastDataCallActivateFailCause;
    305 
    306 /* See RIL_REQUEST_SETUP_DATA_CALL */
    307 typedef enum {
    308     RIL_DATA_PROFILE_DEFAULT    = 0,
    309     RIL_DATA_PROFILE_TETHERED   = 1,
    310     RIL_DATA_PROFILE_OEM_BASE   = 1000    /* Start of OEM-specific profiles */
    311 } RIL_DataProfile;
    312 
    313 /* Used by RIL_UNSOL_SUPP_SVC_NOTIFICATION */
    314 typedef struct {
    315     int     notificationType;   /*
    316                                  * 0 = MO intermediate result code
    317                                  * 1 = MT unsolicited result code
    318                                  */
    319     int     code;               /* See 27.007 7.17
    320                                    "code1" for MO
    321                                    "code2" for MT. */
    322     int     index;              /* CUG index. See 27.007 7.17. */
    323     int     type;               /* "type" from 27.007 7.17 (MT only). */
    324     char *  number;             /* "number" from 27.007 7.17
    325                                    (MT only, may be NULL). */
    326 } RIL_SuppSvcNotification;
    327 
    328 #define RIL_CARD_MAX_APPS     8
    329 
    330 typedef enum {
    331     RIL_CARDSTATE_ABSENT   = 0,
    332     RIL_CARDSTATE_PRESENT  = 1,
    333     RIL_CARDSTATE_ERROR    = 2
    334 } RIL_CardState;
    335 
    336 typedef enum {
    337     RIL_PERSOSUBSTATE_UNKNOWN                   = 0, /* initial state */
    338     RIL_PERSOSUBSTATE_IN_PROGRESS               = 1, /* in between each lock transition */
    339     RIL_PERSOSUBSTATE_READY                     = 2, /* when either SIM or RUIM Perso is finished
    340                                                         since each app can only have 1 active perso
    341                                                         involved */
    342     RIL_PERSOSUBSTATE_SIM_NETWORK               = 3,
    343     RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET        = 4,
    344     RIL_PERSOSUBSTATE_SIM_CORPORATE             = 5,
    345     RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER      = 6,
    346     RIL_PERSOSUBSTATE_SIM_SIM                   = 7,
    347     RIL_PERSOSUBSTATE_SIM_NETWORK_PUK           = 8, /* The corresponding perso lock is blocked */
    348     RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET_PUK    = 9,
    349     RIL_PERSOSUBSTATE_SIM_CORPORATE_PUK         = 10,
    350     RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK  = 11,
    351     RIL_PERSOSUBSTATE_SIM_SIM_PUK               = 12,
    352     RIL_PERSOSUBSTATE_RUIM_NETWORK1             = 13,
    353     RIL_PERSOSUBSTATE_RUIM_NETWORK2             = 14,
    354     RIL_PERSOSUBSTATE_RUIM_HRPD                 = 15,
    355     RIL_PERSOSUBSTATE_RUIM_CORPORATE            = 16,
    356     RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER     = 17,
    357     RIL_PERSOSUBSTATE_RUIM_RUIM                 = 18,
    358     RIL_PERSOSUBSTATE_RUIM_NETWORK1_PUK         = 19, /* The corresponding perso lock is blocked */
    359     RIL_PERSOSUBSTATE_RUIM_NETWORK2_PUK         = 20,
    360     RIL_PERSOSUBSTATE_RUIM_HRPD_PUK             = 21,
    361     RIL_PERSOSUBSTATE_RUIM_CORPORATE_PUK        = 22,
    362     RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER_PUK = 23,
    363     RIL_PERSOSUBSTATE_RUIM_RUIM_PUK             = 24
    364 } RIL_PersoSubstate;
    365 
    366 typedef enum {
    367     RIL_APPSTATE_UNKNOWN               = 0,
    368     RIL_APPSTATE_DETECTED              = 1,
    369     RIL_APPSTATE_PIN                   = 2, /* If PIN1 or UPin is required */
    370     RIL_APPSTATE_PUK                   = 3, /* If PUK1 or Puk for UPin is required */
    371     RIL_APPSTATE_SUBSCRIPTION_PERSO    = 4, /* perso_substate should be look at
    372                                                when app_state is assigned to this value */
    373     RIL_APPSTATE_READY                 = 5
    374 } RIL_AppState;
    375 
    376 typedef enum {
    377     RIL_PINSTATE_UNKNOWN              = 0,
    378     RIL_PINSTATE_ENABLED_NOT_VERIFIED = 1,
    379     RIL_PINSTATE_ENABLED_VERIFIED     = 2,
    380     RIL_PINSTATE_DISABLED             = 3,
    381     RIL_PINSTATE_ENABLED_BLOCKED      = 4,
    382     RIL_PINSTATE_ENABLED_PERM_BLOCKED = 5
    383 } RIL_PinState;
    384 
    385 typedef enum {
    386   RIL_APPTYPE_UNKNOWN = 0,
    387   RIL_APPTYPE_SIM     = 1,
    388   RIL_APPTYPE_USIM    = 2,
    389   RIL_APPTYPE_RUIM    = 3,
    390   RIL_APPTYPE_CSIM    = 4
    391 } RIL_AppType;
    392 
    393 typedef struct
    394 {
    395   RIL_AppType      app_type;
    396   RIL_AppState     app_state;
    397   RIL_PersoSubstate perso_substate; /* applicable only if app_state ==
    398                                        RIL_APPSTATE_SUBSCRIPTION_PERSO */
    399   char             *aid_ptr;        /* null terminated string, e.g., from 0xA0, 0x00 -> 0x41,
    400                                        0x30, 0x30, 0x30 */
    401   char             *app_label_ptr;  /* null terminated string */
    402   int              pin1_replaced;   /* applicable to USIM and CSIM */
    403   RIL_PinState     pin1;
    404   RIL_PinState     pin2;
    405 } RIL_AppStatus;
    406 
    407 typedef struct
    408 {
    409   RIL_CardState card_state;
    410   RIL_PinState  universal_pin_state;             /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */
    411   int           gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS */
    412   int           cdma_subscription_app_index;     /* value < RIL_CARD_MAX_APPS */
    413   int           num_applications;                /* value <= RIL_CARD_MAX_APPS */
    414   RIL_AppStatus applications[RIL_CARD_MAX_APPS];
    415 } RIL_CardStatus;
    416 
    417 /* The result of a SIM refresh, returned in data[0] of RIL_UNSOL_SIM_REFRESH */
    418 typedef enum {
    419     /* A file on SIM has been updated.  data[1] contains the EFID. */
    420     SIM_FILE_UPDATE = 0,
    421     /* SIM initialized.  All files should be re-read. */
    422     SIM_INIT = 1,
    423     /* SIM reset.  SIM power required, SIM may be locked and all files should be re-read. */
    424     SIM_RESET = 2
    425 } RIL_SimRefreshResult;
    426 
    427 typedef struct {
    428     char *          number;             /* Remote party number */
    429     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown */
    430     char *          name;               /* Remote party name */
    431     RIL_CDMA_SignalInfoRecord signalInfoRecord;
    432 } RIL_CDMA_CallWaiting;
    433 
    434 /**
    435  * Which types of Cell Broadcast Message (CBM) are to be received by the ME
    436  *
    437  * uFromServiceID - uToServiceID defines a range of CBM message identifiers
    438  * whose value is 0x0000 - 0xFFFF as defined in TS 23.041 9.4.1.2.2 for GMS
    439  * and 9.4.4.2.2 for UMTS. All other values can be treated as empty
    440  * CBM message ID.
    441  *
    442  * uFromCodeScheme - uToCodeScheme defines a range of CBM data coding schemes
    443  * whose value is 0x00 - 0xFF as defined in TS 23.041 9.4.1.2.3 for GMS
    444  * and 9.4.4.2.3 for UMTS.
    445  * All other values can be treated as empty CBM data coding scheme.
    446  *
    447  * selected 0 means message types specified in <fromServiceId, toServiceId>
    448  * and <fromCodeScheme, toCodeScheme>are not accepted, while 1 means accepted.
    449  *
    450  * Used by RIL_REQUEST_GSM_GET_BROADCAST_CONFIG and
    451  * RIL_REQUEST_GSM_SET_BROADCAST_CONFIG.
    452  */
    453 typedef struct {
    454     int fromServiceId;
    455     int toServiceId;
    456     int fromCodeScheme;
    457     int toCodeScheme;
    458     unsigned char selected;
    459 } RIL_GSM_BroadcastSmsConfigInfo;
    460 
    461 /* No restriction at all including voice/SMS/USSD/SS/AV64 and packet data. */
    462 #define RIL_RESTRICTED_STATE_NONE           0x00
    463 /* Block emergency call due to restriction. But allow all normal voice/SMS/USSD/SS/AV64. */
    464 #define RIL_RESTRICTED_STATE_CS_EMERGENCY   0x01
    465 /* Block all normal voice/SMS/USSD/SS/AV64 due to restriction. Only Emergency call allowed. */
    466 #define RIL_RESTRICTED_STATE_CS_NORMAL      0x02
    467 /* Block all voice/SMS/USSD/SS/AV64 including emergency call due to restriction.*/
    468 #define RIL_RESTRICTED_STATE_CS_ALL         0x04
    469 /* Block packet data access due to restriction. */
    470 #define RIL_RESTRICTED_STATE_PS_ALL         0x10
    471 
    472 /* The status for an OTASP/OTAPA session */
    473 typedef enum {
    474     CDMA_OTA_PROVISION_STATUS_SPL_UNLOCKED,
    475     CDMA_OTA_PROVISION_STATUS_SPC_RETRIES_EXCEEDED,
    476     CDMA_OTA_PROVISION_STATUS_A_KEY_EXCHANGED,
    477     CDMA_OTA_PROVISION_STATUS_SSD_UPDATED,
    478     CDMA_OTA_PROVISION_STATUS_NAM_DOWNLOADED,
    479     CDMA_OTA_PROVISION_STATUS_MDN_DOWNLOADED,
    480     CDMA_OTA_PROVISION_STATUS_IMSI_DOWNLOADED,
    481     CDMA_OTA_PROVISION_STATUS_PRL_DOWNLOADED,
    482     CDMA_OTA_PROVISION_STATUS_COMMITTED,
    483     CDMA_OTA_PROVISION_STATUS_OTAPA_STARTED,
    484     CDMA_OTA_PROVISION_STATUS_OTAPA_STOPPED,
    485     CDMA_OTA_PROVISION_STATUS_OTAPA_ABORTED
    486 } RIL_CDMA_OTA_ProvisionStatus;
    487 
    488 typedef struct {
    489     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
    490     int bitErrorRate;    /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */
    491 } RIL_GW_SignalStrength;
    492 
    493 
    494 typedef struct {
    495     int dbm;  /* Valid values are positive integers.  This value is the actual RSSI value
    496                * multiplied by -1.  Example: If the actual RSSI is -75, then this response
    497                * value will be 75.
    498                */
    499     int ecio; /* Valid values are positive integers.  This value is the actual Ec/Io multiplied
    500                * by -10.  Example: If the actual Ec/Io is -12.5 dB, then this response value
    501                * will be 125.
    502                */
    503 } RIL_CDMA_SignalStrength;
    504 
    505 
    506 typedef struct {
    507     int dbm;  /* Valid values are positive integers.  This value is the actual RSSI value
    508                * multiplied by -1.  Example: If the actual RSSI is -75, then this response
    509                * value will be 75.
    510                */
    511     int ecio; /* Valid values are positive integers.  This value is the actual Ec/Io multiplied
    512                * by -10.  Example: If the actual Ec/Io is -12.5 dB, then this response value
    513                * will be 125.
    514                */
    515     int signalNoiseRatio; /* Valid values are 0-8.  8 is the highest signal to noise ratio. */
    516 } RIL_EVDO_SignalStrength;
    517 
    518 
    519 typedef struct {
    520     RIL_GW_SignalStrength   GW_SignalStrength;
    521     RIL_CDMA_SignalStrength CDMA_SignalStrength;
    522     RIL_EVDO_SignalStrength EVDO_SignalStrength;
    523 } RIL_SignalStrength;
    524 
    525 /* Names of the CDMA info records (C.S0005 section 3.7.5) */
    526 typedef enum {
    527   RIL_CDMA_DISPLAY_INFO_REC,
    528   RIL_CDMA_CALLED_PARTY_NUMBER_INFO_REC,
    529   RIL_CDMA_CALLING_PARTY_NUMBER_INFO_REC,
    530   RIL_CDMA_CONNECTED_NUMBER_INFO_REC,
    531   RIL_CDMA_SIGNAL_INFO_REC,
    532   RIL_CDMA_REDIRECTING_NUMBER_INFO_REC,
    533   RIL_CDMA_LINE_CONTROL_INFO_REC,
    534   RIL_CDMA_EXTENDED_DISPLAY_INFO_REC,
    535   RIL_CDMA_T53_CLIR_INFO_REC,
    536   RIL_CDMA_T53_RELEASE_INFO_REC,
    537   RIL_CDMA_T53_AUDIO_CONTROL_INFO_REC
    538 } RIL_CDMA_InfoRecName;
    539 
    540 /* Display Info Rec as defined in C.S0005 section 3.7.5.1
    541    Extended Display Info Rec as defined in C.S0005 section 3.7.5.16
    542    Note: the Extended Display info rec contains multiple records of the
    543    form: display_tag, display_len, and display_len occurrences of the
    544    chari field if the display_tag is not 10000000 or 10000001.
    545    To save space, the records are stored consecutively in a byte buffer.
    546    The display_tag, display_len and chari fields are all 1 byte.
    547 */
    548 
    549 typedef struct {
    550   char alpha_len;
    551   char alpha_buf[CDMA_ALPHA_INFO_BUFFER_LENGTH];
    552 } RIL_CDMA_DisplayInfoRecord;
    553 
    554 /* Called Party Number Info Rec as defined in C.S0005 section 3.7.5.2
    555    Calling Party Number Info Rec as defined in C.S0005 section 3.7.5.3
    556    Connected Number Info Rec as defined in C.S0005 section 3.7.5.4
    557 */
    558 
    559 typedef struct {
    560   char len;
    561   char buf[CDMA_NUMBER_INFO_BUFFER_LENGTH];
    562   char number_type;
    563   char number_plan;
    564   char pi;
    565   char si;
    566 } RIL_CDMA_NumberInfoRecord;
    567 
    568 /* Redirecting Number Information Record as defined in C.S0005 section 3.7.5.11 */
    569 typedef enum {
    570   RIL_REDIRECTING_REASON_UNKNOWN = 0,
    571   RIL_REDIRECTING_REASON_CALL_FORWARDING_BUSY = 1,
    572   RIL_REDIRECTING_REASON_CALL_FORWARDING_NO_REPLY = 2,
    573   RIL_REDIRECTING_REASON_CALLED_DTE_OUT_OF_ORDER = 9,
    574   RIL_REDIRECTING_REASON_CALL_FORWARDING_BY_THE_CALLED_DTE = 10,
    575   RIL_REDIRECTING_REASON_CALL_FORWARDING_UNCONDITIONAL = 15,
    576   RIL_REDIRECTING_REASON_RESERVED
    577 } RIL_CDMA_RedirectingReason;
    578 
    579 typedef struct {
    580   RIL_CDMA_NumberInfoRecord redirectingNumber;
    581   /* redirectingReason is set to RIL_REDIRECTING_REASON_UNKNOWN if not included */
    582   RIL_CDMA_RedirectingReason redirectingReason;
    583 } RIL_CDMA_RedirectingNumberInfoRecord;
    584 
    585 /* Line Control Information Record as defined in C.S0005 section 3.7.5.15 */
    586 typedef struct {
    587   char lineCtrlPolarityIncluded;
    588   char lineCtrlToggle;
    589   char lineCtrlReverse;
    590   char lineCtrlPowerDenial;
    591 } RIL_CDMA_LineControlInfoRecord;
    592 
    593 /* T53 CLIR Information Record */
    594 typedef struct {
    595   char cause;
    596 } RIL_CDMA_T53_CLIRInfoRecord;
    597 
    598 /* T53 Audio Control Information Record */
    599 typedef struct {
    600   char upLink;
    601   char downLink;
    602 } RIL_CDMA_T53_AudioControlInfoRecord;
    603 
    604 typedef struct {
    605 
    606   RIL_CDMA_InfoRecName name;
    607 
    608   union {
    609     /* Display and Extended Display Info Rec */
    610     RIL_CDMA_DisplayInfoRecord           display;
    611 
    612     /* Called Party Number, Calling Party Number, Connected Number Info Rec */
    613     RIL_CDMA_NumberInfoRecord            number;
    614 
    615     /* Signal Info Rec */
    616     RIL_CDMA_SignalInfoRecord            signal;
    617 
    618     /* Redirecting Number Info Rec */
    619     RIL_CDMA_RedirectingNumberInfoRecord redir;
    620 
    621     /* Line Control Info Rec */
    622     RIL_CDMA_LineControlInfoRecord       lineCtrl;
    623 
    624     /* T53 CLIR Info Rec */
    625     RIL_CDMA_T53_CLIRInfoRecord          clir;
    626 
    627     /* T53 Audio Control Info Rec */
    628     RIL_CDMA_T53_AudioControlInfoRecord  audioCtrl;
    629   } rec;
    630 } RIL_CDMA_InformationRecord;
    631 
    632 #define RIL_CDMA_MAX_NUMBER_OF_INFO_RECS 10
    633 
    634 typedef struct {
    635   char numberOfInfoRecs;
    636   RIL_CDMA_InformationRecord infoRec[RIL_CDMA_MAX_NUMBER_OF_INFO_RECS];
    637 } RIL_CDMA_InformationRecords;
    638 
    639 /**
    640  * RIL_REQUEST_GET_SIM_STATUS
    641  *
    642  * Requests status of the SIM interface and the SIM card
    643  *
    644  * "data" is NULL
    645  *
    646  * "response" is const RIL_CardStatus *
    647  *
    648  * Valid errors:
    649  *  Must never fail
    650  */
    651 #define RIL_REQUEST_GET_SIM_STATUS 1
    652 
    653 /**
    654  * RIL_REQUEST_ENTER_SIM_PIN
    655  *
    656  * Supplies SIM PIN. Only called if RIL_CardStatus has RIL_APPSTATE_PIN state
    657  *
    658  * "data" is const char **
    659  * ((const char **)data)[0] is PIN value
    660  *
    661  * "response" is int *
    662  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
    663  *
    664  * Valid errors:
    665  *
    666  * SUCCESS
    667  * RADIO_NOT_AVAILABLE (radio resetting)
    668  * GENERIC_FAILURE
    669  * PASSWORD_INCORRECT
    670  */
    671 
    672 #define RIL_REQUEST_ENTER_SIM_PIN 2
    673 
    674 
    675 /**
    676  * RIL_REQUEST_ENTER_SIM_PUK
    677  *
    678  * Supplies SIM PUK and new PIN.
    679  *
    680  * "data" is const char **
    681  * ((const char **)data)[0] is PUK value
    682  * ((const char **)data)[1] is new PIN value
    683  *
    684  * "response" is int *
    685  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
    686  *
    687  * Valid errors:
    688  *
    689  *  SUCCESS
    690  *  RADIO_NOT_AVAILABLE (radio resetting)
    691  *  GENERIC_FAILURE
    692  *  PASSWORD_INCORRECT
    693  *     (PUK is invalid)
    694  */
    695 
    696 #define RIL_REQUEST_ENTER_SIM_PUK 3
    697 
    698 /**
    699  * RIL_REQUEST_ENTER_SIM_PIN2
    700  *
    701  * Supplies SIM PIN2. Only called following operation where SIM_PIN2 was
    702  * returned as a a failure from a previous operation.
    703  *
    704  * "data" is const char **
    705  * ((const char **)data)[0] is PIN2 value
    706  *
    707  * "response" is int *
    708  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
    709  *
    710  * Valid errors:
    711  *
    712  *  SUCCESS
    713  *  RADIO_NOT_AVAILABLE (radio resetting)
    714  *  GENERIC_FAILURE
    715  *  PASSWORD_INCORRECT
    716  */
    717 
    718 #define RIL_REQUEST_ENTER_SIM_PIN2 4
    719 
    720 /**
    721  * RIL_REQUEST_ENTER_SIM_PUK2
    722  *
    723  * Supplies SIM PUK2 and new PIN2.
    724  *
    725  * "data" is const char **
    726  * ((const char **)data)[0] is PUK2 value
    727  * ((const char **)data)[1] is new PIN2 value
    728  *
    729  * "response" is int *
    730  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
    731  *
    732  * Valid errors:
    733  *
    734  *  SUCCESS
    735  *  RADIO_NOT_AVAILABLE (radio resetting)
    736  *  GENERIC_FAILURE
    737  *  PASSWORD_INCORRECT
    738  *     (PUK2 is invalid)
    739  */
    740 
    741 #define RIL_REQUEST_ENTER_SIM_PUK2 5
    742 
    743 /**
    744  * RIL_REQUEST_CHANGE_SIM_PIN
    745  *
    746  * Supplies old SIM PIN and new PIN.
    747  *
    748  * "data" is const char **
    749  * ((const char **)data)[0] is old PIN value
    750  * ((const char **)data)[1] is new PIN value
    751  *
    752  * "response" is int *
    753  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
    754  *
    755  * Valid errors:
    756  *
    757  *  SUCCESS
    758  *  RADIO_NOT_AVAILABLE (radio resetting)
    759  *  GENERIC_FAILURE
    760  *  PASSWORD_INCORRECT
    761  *     (old PIN is invalid)
    762  *
    763  */
    764 
    765 #define RIL_REQUEST_CHANGE_SIM_PIN 6
    766 
    767 
    768 /**
    769  * RIL_REQUEST_CHANGE_SIM_PIN2
    770  *
    771  * Supplies old SIM PIN2 and new PIN2.
    772  *
    773  * "data" is const char **
    774  * ((const char **)data)[0] is old PIN2 value
    775  * ((const char **)data)[1] is new PIN2 value
    776  *
    777  * "response" is int *
    778  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
    779  *
    780  * Valid errors:
    781  *
    782  *  SUCCESS
    783  *  RADIO_NOT_AVAILABLE (radio resetting)
    784  *  GENERIC_FAILURE
    785  *  PASSWORD_INCORRECT
    786  *     (old PIN2 is invalid)
    787  *
    788  */
    789 
    790 #define RIL_REQUEST_CHANGE_SIM_PIN2 7
    791 
    792 /**
    793  * RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION
    794  *
    795  * Requests that network personlization be deactivated
    796  *
    797  * "data" is const char **
    798  * ((const char **)(data))[0]] is network depersonlization code
    799  *
    800  * "response" is int *
    801  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
    802  *
    803  * Valid errors:
    804  *
    805  *  SUCCESS
    806  *  RADIO_NOT_AVAILABLE (radio resetting)
    807  *  GENERIC_FAILURE
    808  *  PASSWORD_INCORRECT
    809  *     (code is invalid)
    810  */
    811 
    812 #define RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION 8
    813 
    814 /**
    815  * RIL_REQUEST_GET_CURRENT_CALLS
    816  *
    817  * Requests current call list
    818  *
    819  * "data" is NULL
    820  *
    821  * "response" must be a "const RIL_Call **"
    822  *
    823  * Valid errors:
    824  *
    825  *  SUCCESS
    826  *  RADIO_NOT_AVAILABLE (radio resetting)
    827  *  GENERIC_FAILURE
    828  *      (request will be made again in a few hundred msec)
    829  */
    830 
    831 #define RIL_REQUEST_GET_CURRENT_CALLS 9
    832 
    833 
    834 /**
    835  * RIL_REQUEST_DIAL
    836  *
    837  * Initiate voice call
    838  *
    839  * "data" is const RIL_Dial *
    840  * "response" is NULL
    841  *
    842  * This method is never used for supplementary service codes
    843  *
    844  * Valid errors:
    845  *  SUCCESS
    846  *  RADIO_NOT_AVAILABLE (radio resetting)
    847  *  GENERIC_FAILURE
    848  */
    849 #define RIL_REQUEST_DIAL 10
    850 
    851 /**
    852  * RIL_REQUEST_GET_IMSI
    853  *
    854  * Get the SIM IMSI
    855  *
    856  * Only valid when radio state is "RADIO_STATE_SIM_READY"
    857  *
    858  * "data" is NULL
    859  * "response" is a const char * containing the IMSI
    860  *
    861  * Valid errors:
    862  *  SUCCESS
    863  *  RADIO_NOT_AVAILABLE (radio resetting)
    864  *  GENERIC_FAILURE
    865  */
    866 
    867 #define RIL_REQUEST_GET_IMSI 11
    868 
    869 /**
    870  * RIL_REQUEST_HANGUP
    871  *
    872  * Hang up a specific line (like AT+CHLD=1x)
    873  *
    874  * After this HANGUP request returns, RIL should show the connection is NOT
    875  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
    876  *
    877  * "data" is an int *
    878  * (int *)data)[0] contains Connection index (value of 'x' in CHLD above)
    879  *
    880  * "response" is NULL
    881  *
    882  * Valid errors:
    883  *  SUCCESS
    884  *  RADIO_NOT_AVAILABLE (radio resetting)
    885  *  GENERIC_FAILURE
    886  */
    887 
    888 #define RIL_REQUEST_HANGUP 12
    889 
    890 /**
    891  * RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND
    892  *
    893  * Hang up waiting or held (like AT+CHLD=0)
    894  *
    895  * After this HANGUP request returns, RIL should show the connection is NOT
    896  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
    897  *
    898  * "data" is NULL
    899  * "response" is NULL
    900  *
    901  * Valid errors:
    902  *  SUCCESS
    903  *  RADIO_NOT_AVAILABLE (radio resetting)
    904  *  GENERIC_FAILURE
    905  */
    906 
    907 #define RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND 13
    908 
    909 /**
    910  * RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND
    911  *
    912  * Hang up waiting or held (like AT+CHLD=1)
    913  *
    914  * After this HANGUP request returns, RIL should show the connection is NOT
    915  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
    916  *
    917  * "data" is NULL
    918  * "response" is NULL
    919  *
    920  * Valid errors:
    921  *  SUCCESS
    922  *  RADIO_NOT_AVAILABLE (radio resetting)
    923  *  GENERIC_FAILURE
    924  */
    925 
    926 #define RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND 14
    927 
    928 /**
    929  * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE
    930  *
    931  * Switch waiting or holding call and active call (like AT+CHLD=2)
    932  *
    933  * State transitions should be is follows:
    934  *
    935  * If call 1 is waiting and call 2 is active, then if this re
    936  *
    937  *   BEFORE                               AFTER
    938  * Call 1   Call 2                 Call 1       Call 2
    939  * ACTIVE   HOLDING                HOLDING     ACTIVE
    940  * ACTIVE   WAITING                HOLDING     ACTIVE
    941  * HOLDING  WAITING                HOLDING     ACTIVE
    942  * ACTIVE   IDLE                   HOLDING     IDLE
    943  * IDLE     IDLE                   IDLE        IDLE
    944  *
    945  * "data" is NULL
    946  * "response" is NULL
    947  *
    948  * Valid errors:
    949  *  SUCCESS
    950  *  RADIO_NOT_AVAILABLE (radio resetting)
    951  *  GENERIC_FAILURE
    952  */
    953 
    954 #define RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE 15
    955 #define RIL_REQUEST_SWITCH_HOLDING_AND_ACTIVE 15
    956 
    957 /**
    958  * RIL_REQUEST_CONFERENCE
    959  *
    960  * Conference holding and active (like AT+CHLD=3)
    961 
    962  * "data" is NULL
    963  * "response" is NULL
    964  *
    965  * Valid errors:
    966  *  SUCCESS
    967  *  RADIO_NOT_AVAILABLE (radio resetting)
    968  *  GENERIC_FAILURE
    969  */
    970 #define RIL_REQUEST_CONFERENCE 16
    971 
    972 /**
    973  * RIL_REQUEST_UDUB
    974  *
    975  * Send UDUB (user determined used busy) to ringing or
    976  * waiting call answer)(RIL_BasicRequest r);
    977  *
    978  * "data" is NULL
    979  * "response" is NULL
    980  *
    981  * Valid errors:
    982  *  SUCCESS
    983  *  RADIO_NOT_AVAILABLE (radio resetting)
    984  *  GENERIC_FAILURE
    985  */
    986 #define RIL_REQUEST_UDUB 17
    987 
    988 /**
    989  * RIL_REQUEST_LAST_CALL_FAIL_CAUSE
    990  *
    991  * Requests the failure cause code for the most recently terminated call
    992  *
    993  * "data" is NULL
    994  * "response" is a "int *"
    995  * ((int *)response)[0] is RIL_LastCallFailCause.  GSM failure reasons are
    996  * mapped to cause codes defined in TS 24.008 Annex H where possible. CDMA
    997  * failure reasons are derived from the possible call failure scenarios
    998  * described in the "CDMA IS-2000 Release A (C.S0005-A v6.0)" standard.
    999  *
   1000  * The implementation should return CALL_FAIL_ERROR_UNSPECIFIED for blocked
   1001  * MO calls by restricted state (See RIL_UNSOL_RESTRICTED_STATE_CHANGED)
   1002  *
   1003  * If the implementation does not have access to the exact cause codes,
   1004  * then it should return one of the values listed in RIL_LastCallFailCause,
   1005  * as the UI layer needs to distinguish these cases for tone generation or
   1006  * error notification.
   1007  *
   1008  * Valid errors:
   1009  *  SUCCESS
   1010  *  RADIO_NOT_AVAILABLE
   1011  *  GENERIC_FAILURE
   1012  *
   1013  * See also: RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE
   1014  */
   1015 #define RIL_REQUEST_LAST_CALL_FAIL_CAUSE 18
   1016 
   1017 /**
   1018  * RIL_REQUEST_SIGNAL_STRENGTH
   1019  *
   1020  * Requests current signal strength and associated information
   1021  *
   1022  * Must succeed if radio is on.
   1023  *
   1024  * "data" is NULL
   1025  *
   1026  * "response" is a const RIL_SignalStrength *
   1027  *
   1028  * Valid errors:
   1029  *  SUCCESS
   1030  *  RADIO_NOT_AVAILABLE
   1031  */
   1032 #define RIL_REQUEST_SIGNAL_STRENGTH 19
   1033 
   1034 /**
   1035  * RIL_REQUEST_REGISTRATION_STATE
   1036  *
   1037  * Request current registration state
   1038  *
   1039  * "data" is NULL
   1040  * "response" is a "char **"
   1041  * ((const char **)response)[0] is registration state 0-6,
   1042  *              0 - Not registered, MT is not currently searching
   1043  *                  a new operator to register
   1044  *              1 - Registered, home network
   1045  *              2 - Not registered, but MT is currently searching
   1046  *                  a new operator to register
   1047  *              3 - Registration denied
   1048  *              4 - Unknown
   1049  *              5 - Registered, roaming
   1050  *             10 - Same as 0, but indicates that emergency calls
   1051  *                  are enabled.
   1052  *             12 - Same as 2, but indicates that emergency calls
   1053  *                  are enabled.
   1054  *             13 - Same as 3, but indicates that emergency calls
   1055  *                  are enabled.
   1056  *             14 - Same as 4, but indicates that emergency calls
   1057  *                  are enabled.
   1058  *
   1059  * ((const char **)response)[1] is LAC if registered on a GSM/WCDMA system or
   1060  *                              NULL if not.Valid LAC are 0x0000 - 0xffff
   1061  * ((const char **)response)[2] is CID if registered on a * GSM/WCDMA or
   1062  *                              NULL if not.
   1063  *                                 Valid CID are 0x00000000 - 0xffffffff
   1064  *                                    In GSM, CID is Cell ID (see TS 27.007)
   1065  *                                            in 16 bits
   1066  *                                    In UMTS, CID is UMTS Cell Identity
   1067  *                                             (see TS 25.331) in 28 bits
   1068  * ((const char **)response)[3] indicates the available radio technology 0-7,
   1069  *                                  0 - Unknown, 1 - GPRS, 2 - EDGE, 3 - UMTS,
   1070  *                                  4 - IS95A, 5 - IS95B, 6 - 1xRTT,
   1071  *                                  7 - EvDo Rev. 0, 8 - EvDo Rev. A,
   1072  *                                  9 - HSDPA, 10 - HSUPA, 11 - HSPA,
   1073  *                                  12 - EVDO Rev B
   1074  * ((const char **)response)[4] is Base Station ID if registered on a CDMA
   1075  *                              system or NULL if not.  Base Station ID in
   1076  *                              decimal format
   1077  * ((const char **)response)[5] is Base Station latitude if registered on a
   1078  *                              CDMA system or NULL if not. Base Station
   1079  *                              latitude is a decimal number as specified in
   1080  *                              3GPP2 C.S0005-A v6.0. It is represented in
   1081  *                              units of 0.25 seconds and ranges from -1296000
   1082  *                              to 1296000, both values inclusive (corresponding
   1083  *                              to a range of -90 to +90).
   1084  * ((const char **)response)[6] is Base Station longitude if registered on a
   1085  *                              CDMA system or NULL if not. Base Station
   1086  *                              longitude is a decimal number as specified in
   1087  *                              3GPP2 C.S0005-A v6.0. It is represented in
   1088  *                              units of 0.25 seconds and ranges from -2592000
   1089  *                              to 2592000, both values inclusive (corresponding
   1090  *                              to a range of -180 to +180).
   1091  * ((const char **)response)[7] is concurrent services support indicator if
   1092  *                              registered on a CDMA system 0-1.
   1093  *                                   0 - Concurrent services not supported,
   1094  *                                   1 - Concurrent services supported
   1095  * ((const char **)response)[8] is System ID if registered on a CDMA system or
   1096  *                              NULL if not. Valid System ID are 0 - 32767
   1097  * ((const char **)response)[9] is Network ID if registered on a CDMA system or
   1098  *                              NULL if not. Valid System ID are 0 - 65535
   1099  * ((const char **)response)[10] is the TSB-58 Roaming Indicator if registered
   1100  *                               on a CDMA or EVDO system or NULL if not. Valid values
   1101  *                               are 0-255.
   1102  * ((const char **)response)[11] indicates whether the current system is in the
   1103  *                               PRL if registered on a CDMA or EVDO system or NULL if
   1104  *                               not. 0=not in the PRL, 1=in the PRL
   1105  * ((const char **)response)[12] is the default Roaming Indicator from the PRL,
   1106  *                               if registered on a CDMA or EVDO system or NULL if not.
   1107  *                               Valid values are 0-255.
   1108  * ((const char **)response)[13] if registration state is 3 (Registration
   1109  *                               denied) this is an enumerated reason why
   1110  *                               registration was denied.  See 3GPP TS 24.008,
   1111  *                               10.5.3.6 and Annex G.
   1112  *                                 0 - General
   1113  *                                 1 - Authentication Failure
   1114  *                                 2 - IMSI unknown in HLR
   1115  *                                 3 - Illegal MS
   1116  *                                 4 - Illegal ME
   1117  *                                 5 - PLMN not allowed
   1118  *                                 6 - Location area not allowed
   1119  *                                 7 - Roaming not allowed
   1120  *                                 8 - No Suitable Cells in this Location Area
   1121  *                                 9 - Network failure
   1122  *                                10 - Persistent location update reject
   1123  * ((const char **)response)[14] is the Primary Scrambling Code of the current
   1124  *                               cell as described in TS 25.331, in hexadecimal
   1125  *                               format, or NULL if unknown or not registered
   1126  *                               to a UMTS network.
   1127  *
   1128  * Please note that registration state 4 ("unknown") is treated
   1129  * as "out of service" in the Android telephony system
   1130  *
   1131  * Registration state 3 can be returned if Location Update Reject
   1132  * (with cause 17 - Network Failure) is received repeatedly from the network,
   1133  * to facilitate "managed roaming"
   1134  *
   1135  * Valid errors:
   1136  *  SUCCESS
   1137  *  RADIO_NOT_AVAILABLE
   1138  *  GENERIC_FAILURE
   1139  */
   1140 #define RIL_REQUEST_REGISTRATION_STATE 20
   1141 
   1142 /**
   1143  * RIL_REQUEST_GPRS_REGISTRATION_STATE
   1144  *
   1145  * Request current GPRS registration state
   1146  *
   1147  * "data" is NULL
   1148  * "response" is a "char **"
   1149  * ((const char **)response)[0] is registration state 0-5 from TS 27.007 10.1.20 AT+CGREG
   1150  * ((const char **)response)[1] is LAC if registered or NULL if not
   1151  * ((const char **)response)[2] is CID if registered or NULL if not
   1152  * ((const char **)response)[3] indicates the available radio technology, where:
   1153  *      0 == unknown
   1154  *      1 == GPRS only
   1155  *      2 == EDGE
   1156  *      3 == UMTS
   1157  *      9 == HSDPA
   1158  *      10 == HSUPA
   1159  *      11 == HSPA
   1160  *
   1161  * LAC and CID are in hexadecimal format.
   1162  * valid LAC are 0x0000 - 0xffff
   1163  * valid CID are 0x00000000 - 0x0fffffff
   1164  *
   1165  * Please note that registration state 4 ("unknown") is treated
   1166  * as "out of service" in the Android telephony system
   1167  *
   1168  * Valid errors:
   1169  *  SUCCESS
   1170  *  RADIO_NOT_AVAILABLE
   1171  *  GENERIC_FAILURE
   1172  */
   1173 #define RIL_REQUEST_GPRS_REGISTRATION_STATE 21
   1174 
   1175 /**
   1176  * RIL_REQUEST_OPERATOR
   1177  *
   1178  * Request current operator ONS or EONS
   1179  *
   1180  * "data" is NULL
   1181  * "response" is a "const char **"
   1182  * ((const char **)response)[0] is long alpha ONS or EONS
   1183  *                                  or NULL if unregistered
   1184  *
   1185  * ((const char **)response)[1] is short alpha ONS or EONS
   1186  *                                  or NULL if unregistered
   1187  * ((const char **)response)[2] is 5 or 6 digit numeric code (MCC + MNC)
   1188  *                                  or NULL if unregistered
   1189  *
   1190  * Valid errors:
   1191  *  SUCCESS
   1192  *  RADIO_NOT_AVAILABLE
   1193  *  GENERIC_FAILURE
   1194  */
   1195 #define RIL_REQUEST_OPERATOR 22
   1196 
   1197 /**
   1198  * RIL_REQUEST_RADIO_POWER
   1199  *
   1200  * Toggle radio on and off (for "airplane" mode)
   1201  * "data" is int *
   1202  * ((int *)data)[0] is > 0 for "Radio On"
   1203  * ((int *)data)[0] is == 0 for "Radio Off"
   1204  *
   1205  * "response" is NULL
   1206  *
   1207  * Turn radio on if "on" > 0
   1208  * Turn radio off if "on" == 0
   1209  *
   1210  * Valid errors:
   1211  *  SUCCESS
   1212  *  RADIO_NOT_AVAILABLE
   1213  *  GENERIC_FAILURE
   1214  */
   1215 #define RIL_REQUEST_RADIO_POWER 23
   1216 
   1217 /**
   1218  * RIL_REQUEST_DTMF
   1219  *
   1220  * Send a DTMF tone
   1221  *
   1222  * If the implementation is currently playing a tone requested via
   1223  * RIL_REQUEST_DTMF_START, that tone should be cancelled and the new tone
   1224  * should be played instead
   1225  *
   1226  * "data" is a char * containing a single character with one of 12 values: 0-9,*,#
   1227  * "response" is NULL
   1228  *
   1229  * FIXME should this block/mute microphone?
   1230  * How does this interact with local DTMF feedback?
   1231  *
   1232  * Valid errors:
   1233  *  SUCCESS
   1234  *  RADIO_NOT_AVAILABLE
   1235  *  GENERIC_FAILURE
   1236  *
   1237  * See also: RIL_REQUEST_DTMF_STOP, RIL_REQUEST_DTMF_START
   1238  *
   1239  */
   1240 #define RIL_REQUEST_DTMF 24
   1241 
   1242 /**
   1243  * RIL_REQUEST_SEND_SMS
   1244  *
   1245  * Send an SMS message
   1246  *
   1247  * "data" is const char **
   1248  * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
   1249  *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
   1250  * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
   1251  *      less the SMSC address
   1252  *      TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
   1253  *
   1254  * "response" is a const RIL_SMS_Response *
   1255  *
   1256  * Based on the return error, caller decides to resend if sending sms
   1257  * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
   1258  * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
   1259  *
   1260  * Valid errors:
   1261  *  SUCCESS
   1262  *  RADIO_NOT_AVAILABLE
   1263  *  SMS_SEND_FAIL_RETRY
   1264  *  FDN_CHECK_FAILURE
   1265  *  GENERIC_FAILURE
   1266  *
   1267  * FIXME how do we specify TP-Message-Reference if we need to resend?
   1268  */
   1269 #define RIL_REQUEST_SEND_SMS 25
   1270 
   1271 
   1272 /**
   1273  * RIL_REQUEST_SEND_SMS_EXPECT_MORE
   1274  *
   1275  * Send an SMS message. Identical to RIL_REQUEST_SEND_SMS,
   1276  * except that more messages are expected to be sent soon. If possible,
   1277  * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command)
   1278  *
   1279  * "data" is const char **
   1280  * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
   1281  *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
   1282  * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
   1283  *      less the SMSC address
   1284  *      TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
   1285  *
   1286  * "response" is a const RIL_SMS_Response *
   1287  *
   1288  * Based on the return error, caller decides to resend if sending sms
   1289  * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
   1290  * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
   1291  *
   1292  * Valid errors:
   1293  *  SUCCESS
   1294  *  RADIO_NOT_AVAILABLE
   1295  *  SMS_SEND_FAIL_RETRY
   1296  *  GENERIC_FAILURE
   1297  *
   1298  */
   1299 #define RIL_REQUEST_SEND_SMS_EXPECT_MORE 26
   1300 
   1301 
   1302 /**
   1303  * RIL_REQUEST_SETUP_DATA_CALL
   1304  *
   1305  * Setup a packet data connection
   1306  *
   1307  * "data" is a const char **
   1308  * ((const char **)data)[0] indicates whether to setup connection on radio technology CDMA
   1309  *                              or GSM/UMTS, 0-1. 0 - CDMA, 1-GSM/UMTS
   1310  *
   1311  * ((const char **)data)[1] is a RIL_DataProfile (support is optional)
   1312  * ((const char **)data)[2] is the APN to connect to if radio technology is GSM/UMTS. This APN will
   1313  *                          override the one in the profile. NULL indicates no APN overrride.
   1314  * ((const char **)data)[3] is the username for APN, or NULL
   1315  * ((const char **)data)[4] is the password for APN, or NULL
   1316  * ((const char **)data)[5] is the PAP / CHAP auth type. Values:
   1317  *                          0 => PAP and CHAP is never performed.
   1318  *                          1 => PAP may be performed; CHAP is never performed.
   1319  *                          2 => CHAP may be performed; PAP is never performed.
   1320  *                          3 => PAP / CHAP may be performed - baseband dependent.
   1321  * ((const char **)data)[6] is the PDP type to request if the radio technology is GSM/UMTS.
   1322  *                          Must be one of the PDP_type values in TS 27.007 section 10.1.1.
   1323  *                          For example, "IP", "IPV6", "IPV4V6", or "PPP".
   1324  *
   1325  * "response" is a char **
   1326  * ((char **)response)[0] the Connection ID, CID, which is generated by RIL.
   1327  * ((char **)response)[1] the network interface name.
   1328  * ((char **)response)[2] a numeric IPv4 or IPv6 address that has been assigned to the interface.
   1329  * ((char **)response)[3] a space-separated list of numeric IPv4 or IPv6 DNS addresses.
   1330  *                        Ignored on Android platforms before 3.0 and instead two DNS IP addresses
   1331  *                        are retrieved from system properties "net.$IN.dns1" and "net.$IN.dns2".
   1332  * ((char **)response)[4] the numeric IPv4 or IPv6 address of the default gateway.
   1333  *                        Ignored on Android platforms before 3.0 and instead an IP address
   1334  *                        is retrieved from system property "net.$IN.gw".
   1335  *
   1336  * Notes:
   1337  *   1) Numeric addresses must be in the Java InetAddress parsable representation.
   1338  *   2) $IN in the above comments is the interface name from response[1].
   1339  *
   1340  * Valid errors:
   1341  *  SUCCESS
   1342  *  RADIO_NOT_AVAILABLE
   1343  *  GENERIC_FAILURE
   1344  *
   1345  * See also: RIL_REQUEST_DEACTIVATE_DATA_CALL
   1346  */
   1347 #define RIL_REQUEST_SETUP_DATA_CALL 27
   1348 
   1349 
   1350 
   1351 /**
   1352  * RIL_REQUEST_SIM_IO
   1353  *
   1354  * Request SIM I/O operation.
   1355  * This is similar to the TS 27.007 "restricted SIM" operation
   1356  * where it assumes all of the EF selection will be done by the
   1357  * callee.
   1358  *
   1359  * "data" is a const RIL_SIM_IO *
   1360  * Please note that RIL_SIM_IO has a "PIN2" field which may be NULL,
   1361  * or may specify a PIN2 for operations that require a PIN2 (eg
   1362  * updating FDN records)
   1363  *
   1364  * "response" is a const RIL_SIM_IO_Response *
   1365  *
   1366  * Arguments and responses that are unused for certain
   1367  * values of "command" should be ignored or set to NULL
   1368  *
   1369  * Valid errors:
   1370  *  SUCCESS
   1371  *  RADIO_NOT_AVAILABLE
   1372  *  GENERIC_FAILURE
   1373  *  SIM_PIN2
   1374  *  SIM_PUK2
   1375  */
   1376 #define RIL_REQUEST_SIM_IO 28
   1377 
   1378 /**
   1379  * RIL_REQUEST_SEND_USSD
   1380  *
   1381  * Send a USSD message
   1382  *
   1383  * If a USSD session already exists, the message should be sent in the
   1384  * context of that session. Otherwise, a new session should be created.
   1385  *
   1386  * The network reply should be reported via RIL_UNSOL_ON_USSD
   1387  *
   1388  * Only one USSD session may exist at a time, and the session is assumed
   1389  * to exist until:
   1390  *   a) The android system invokes RIL_REQUEST_CANCEL_USSD
   1391  *   b) The implementation sends a RIL_UNSOL_ON_USSD with a type code
   1392  *      of "0" (USSD-Notify/no further action) or "2" (session terminated)
   1393  *
   1394  * "data" is a const char * containing the USSD request in UTF-8 format
   1395  * "response" is NULL
   1396  *
   1397  * Valid errors:
   1398  *  SUCCESS
   1399  *  RADIO_NOT_AVAILABLE
   1400  *  FDN_CHECK_FAILURE
   1401  *  GENERIC_FAILURE
   1402  *
   1403  * See also: RIL_REQUEST_CANCEL_USSD, RIL_UNSOL_ON_USSD
   1404  */
   1405 
   1406 #define RIL_REQUEST_SEND_USSD 29
   1407 
   1408 /**
   1409  * RIL_REQUEST_CANCEL_USSD
   1410  *
   1411  * Cancel the current USSD session if one exists
   1412  *
   1413  * "data" is null
   1414  * "response" is NULL
   1415  *
   1416  * Valid errors:
   1417  *  SUCCESS
   1418  *  RADIO_NOT_AVAILABLE
   1419  *  GENERIC_FAILURE
   1420  */
   1421 
   1422 #define RIL_REQUEST_CANCEL_USSD 30
   1423 
   1424 /**
   1425  * RIL_REQUEST_GET_CLIR
   1426  *
   1427  * Gets current CLIR status
   1428  * "data" is NULL
   1429  * "response" is int *
   1430  * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
   1431  * ((int *)data)[1] is "m" parameter from TS 27.007 7.7
   1432  *
   1433  * Valid errors:
   1434  *  SUCCESS
   1435  *  RADIO_NOT_AVAILABLE
   1436  *  GENERIC_FAILURE
   1437  */
   1438 #define RIL_REQUEST_GET_CLIR 31
   1439 
   1440 /**
   1441  * RIL_REQUEST_SET_CLIR
   1442  *
   1443  * "data" is int *
   1444  * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
   1445  *
   1446  * "response" is NULL
   1447  *
   1448  * Valid errors:
   1449  *  SUCCESS
   1450  *  RADIO_NOT_AVAILABLE
   1451  *  GENERIC_FAILURE
   1452  */
   1453 #define RIL_REQUEST_SET_CLIR 32
   1454 
   1455 /**
   1456  * RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
   1457  *
   1458  * "data" is const RIL_CallForwardInfo *
   1459  *
   1460  * "response" is const RIL_CallForwardInfo **
   1461  * "response" points to an array of RIL_CallForwardInfo *'s, one for
   1462  * each distinct registered phone number.
   1463  *
   1464  * For example, if data is forwarded to +18005551212 and voice is forwarded
   1465  * to +18005559999, then two separate RIL_CallForwardInfo's should be returned
   1466  *
   1467  * If, however, both data and voice are forwarded to +18005551212, then
   1468  * a single RIL_CallForwardInfo can be returned with the service class
   1469  * set to "data + voice = 3")
   1470  *
   1471  * Valid errors:
   1472  *  SUCCESS
   1473  *  RADIO_NOT_AVAILABLE
   1474  *  GENERIC_FAILURE
   1475  */
   1476 #define RIL_REQUEST_QUERY_CALL_FORWARD_STATUS 33
   1477 
   1478 
   1479 /**
   1480  * RIL_REQUEST_SET_CALL_FORWARD
   1481  *
   1482  * Configure call forward rule
   1483  *
   1484  * "data" is const RIL_CallForwardInfo *
   1485  * "response" is NULL
   1486  *
   1487  * Valid errors:
   1488  *  SUCCESS
   1489  *  RADIO_NOT_AVAILABLE
   1490  *  GENERIC_FAILURE
   1491  */
   1492 #define RIL_REQUEST_SET_CALL_FORWARD 34
   1493 
   1494 
   1495 /**
   1496  * RIL_REQUEST_QUERY_CALL_WAITING
   1497  *
   1498  * Query current call waiting state
   1499  *
   1500  * "data" is const int *
   1501  * ((const int *)data)[0] is the TS 27.007 service class to query.
   1502  * "response" is a const int *
   1503  * ((const int *)response)[0] is 0 for "disabled" and 1 for "enabled"
   1504  *
   1505  * If ((const int *)response)[0] is = 1, then ((const int *)response)[1]
   1506  * must follow, with the TS 27.007 service class bit vector of services
   1507  * for which call waiting is enabled.
   1508  *
   1509  * For example, if ((const int *)response)[0]  is 1 and
   1510  * ((const int *)response)[1] is 3, then call waiting is enabled for data
   1511  * and voice and disabled for everything else
   1512  *
   1513  * Valid errors:
   1514  *  SUCCESS
   1515  *  RADIO_NOT_AVAILABLE
   1516  *  GENERIC_FAILURE
   1517  */
   1518 #define RIL_REQUEST_QUERY_CALL_WAITING 35
   1519 
   1520 
   1521 /**
   1522  * RIL_REQUEST_SET_CALL_WAITING
   1523  *
   1524  * Configure current call waiting state
   1525  *
   1526  * "data" is const int *
   1527  * ((const int *)data)[0] is 0 for "disabled" and 1 for "enabled"
   1528  * ((const int *)data)[1] is the TS 27.007 service class bit vector of
   1529  *                           services to modify
   1530  * "response" is NULL
   1531  *
   1532  * Valid errors:
   1533  *  SUCCESS
   1534  *  RADIO_NOT_AVAILABLE
   1535  *  GENERIC_FAILURE
   1536  */
   1537 #define RIL_REQUEST_SET_CALL_WAITING 36
   1538 
   1539 /**
   1540  * RIL_REQUEST_SMS_ACKNOWLEDGE
   1541  *
   1542  * Acknowledge successful or failed receipt of SMS previously indicated
   1543  * via RIL_UNSOL_RESPONSE_NEW_SMS
   1544  *
   1545  * "data" is int *
   1546  * ((int *)data)[0] is 1 on successful receipt
   1547  *                  (basically, AT+CNMA=1 from TS 27.005
   1548  *                  is 0 on failed receipt
   1549  *                  (basically, AT+CNMA=2 from TS 27.005)
   1550  * ((int *)data)[1] if data[0] is 0, this contains the failure cause as defined
   1551  *                  in TS 23.040, 9.2.3.22. Currently only 0xD3 (memory
   1552  *                  capacity exceeded) and 0xFF (unspecified error) are
   1553  *                  reported.
   1554  *
   1555  * "response" is NULL
   1556  *
   1557  * FIXME would like request that specified RP-ACK/RP-ERROR PDU
   1558  *
   1559  * Valid errors:
   1560  *  SUCCESS
   1561  *  RADIO_NOT_AVAILABLE
   1562  *  GENERIC_FAILURE
   1563  */
   1564 #define RIL_REQUEST_SMS_ACKNOWLEDGE  37
   1565 
   1566 /**
   1567  * RIL_REQUEST_GET_IMEI - DEPRECATED
   1568  *
   1569  * Get the device IMEI, including check digit
   1570  *
   1571  * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY
   1572  * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
   1573  *
   1574  * "data" is NULL
   1575  * "response" is a const char * containing the IMEI
   1576  *
   1577  * Valid errors:
   1578  *  SUCCESS
   1579  *  RADIO_NOT_AVAILABLE (radio resetting)
   1580  *  GENERIC_FAILURE
   1581  */
   1582 
   1583 #define RIL_REQUEST_GET_IMEI 38
   1584 
   1585 /**
   1586  * RIL_REQUEST_GET_IMEISV - DEPRECATED
   1587  *
   1588  * Get the device IMEISV, which should be two decimal digits
   1589  *
   1590  * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY
   1591  * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
   1592  *
   1593  * "data" is NULL
   1594  * "response" is a const char * containing the IMEISV
   1595  *
   1596  * Valid errors:
   1597  *  SUCCESS
   1598  *  RADIO_NOT_AVAILABLE (radio resetting)
   1599  *  GENERIC_FAILURE
   1600  */
   1601 
   1602 #define RIL_REQUEST_GET_IMEISV 39
   1603 
   1604 
   1605 /**
   1606  * RIL_REQUEST_ANSWER
   1607  *
   1608  * Answer incoming call
   1609  *
   1610  * Will not be called for WAITING calls.
   1611  * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE will be used in this case
   1612  * instead
   1613  *
   1614  * "data" is NULL
   1615  * "response" is NULL
   1616  *
   1617  * Valid errors:
   1618  *  SUCCESS
   1619  *  RADIO_NOT_AVAILABLE (radio resetting)
   1620  *  GENERIC_FAILURE
   1621  */
   1622 
   1623 #define RIL_REQUEST_ANSWER 40
   1624 
   1625 /**
   1626  * RIL_REQUEST_DEACTIVATE_DATA_CALL
   1627  *
   1628  * Deactivate packet data connection
   1629  * replaces RIL_REQUEST_DEACTIVATE_DEFAULT_PDP
   1630  *
   1631  * "data" is const char **
   1632  * ((char**)data)[0] indicating CID
   1633  * ((char**)data)[1] indicating Disconnect Reason
   1634  *                   0 => No specific reason specified
   1635  *                   1 => Radio shutdown requested
   1636  *
   1637  * "response" is NULL
   1638  *
   1639  * Valid errors:
   1640  *  SUCCESS
   1641  *  RADIO_NOT_AVAILABLE
   1642  *  GENERIC_FAILURE
   1643  *
   1644  * See also: RIL_REQUEST_SETUP_DATA_CALL
   1645  */
   1646 #define RIL_REQUEST_DEACTIVATE_DATA_CALL 41
   1647 
   1648 /**
   1649  * RIL_REQUEST_QUERY_FACILITY_LOCK
   1650  *
   1651  * Query the status of a facility lock state
   1652  *
   1653  * "data" is const char **
   1654  * ((const char **)data)[0] is the facility string code from TS 27.007 7.4
   1655  *                      (eg "AO" for BAOC, "SC" for SIM lock)
   1656  * ((const char **)data)[1] is the password, or "" if not required
   1657  * ((const char **)data)[2] is the TS 27.007 service class bit vector of
   1658  *                           services to query
   1659  *
   1660  * "response" is an int *
   1661  * ((const int *)response) 0 is the TS 27.007 service class bit vector of
   1662  *                           services for which the specified barring facility
   1663  *                           is active. "0" means "disabled for all"
   1664  *
   1665  *
   1666  * Valid errors:
   1667  *  SUCCESS
   1668  *  RADIO_NOT_AVAILABLE
   1669  *  GENERIC_FAILURE
   1670  *
   1671  */
   1672 #define RIL_REQUEST_QUERY_FACILITY_LOCK 42
   1673 
   1674 /**
   1675  * RIL_REQUEST_SET_FACILITY_LOCK
   1676  *
   1677  * Enable/disable one facility lock
   1678  *
   1679  * "data" is const char **
   1680  *
   1681  * ((const char **)data)[0] = facility string code from TS 27.007 7.4
   1682  * (eg "AO" for BAOC)
   1683  * ((const char **)data)[1] = "0" for "unlock" and "1" for "lock"
   1684  * ((const char **)data)[2] = password
   1685  * ((const char **)data)[3] = string representation of decimal TS 27.007
   1686  *                            service class bit vector. Eg, the string
   1687  *                            "1" means "set this facility for voice services"
   1688  *
   1689  * "response" is int *
   1690  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
   1691  *
   1692  * Valid errors:
   1693  *  SUCCESS
   1694  *  RADIO_NOT_AVAILABLE
   1695  *  GENERIC_FAILURE
   1696  *
   1697  */
   1698 #define RIL_REQUEST_SET_FACILITY_LOCK 43
   1699 
   1700 /**
   1701  * RIL_REQUEST_CHANGE_BARRING_PASSWORD
   1702  *
   1703  * Change call barring facility password
   1704  *
   1705  * "data" is const char **
   1706  *
   1707  * ((const char **)data)[0] = facility string code from TS 27.007 7.4
   1708  * (eg "AO" for BAOC)
   1709  * ((const char **)data)[1] = old password
   1710  * ((const char **)data)[2] = new password
   1711  *
   1712  * "response" is NULL
   1713  *
   1714  * Valid errors:
   1715  *  SUCCESS
   1716  *  RADIO_NOT_AVAILABLE
   1717  *  GENERIC_FAILURE
   1718  *
   1719  */
   1720 #define RIL_REQUEST_CHANGE_BARRING_PASSWORD 44
   1721 
   1722 /**
   1723  * RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE
   1724  *
   1725  * Query current network selectin mode
   1726  *
   1727  * "data" is NULL
   1728  *
   1729  * "response" is int *
   1730  * ((const int *)response)[0] is
   1731  *     0 for automatic selection
   1732  *     1 for manual selection
   1733  *
   1734  * Valid errors:
   1735  *  SUCCESS
   1736  *  RADIO_NOT_AVAILABLE
   1737  *  GENERIC_FAILURE
   1738  *
   1739  */
   1740 #define RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE 45
   1741 
   1742 /**
   1743  * RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC
   1744  *
   1745  * Specify that the network should be selected automatically
   1746  *
   1747  * "data" is NULL
   1748  * "response" is NULL
   1749  *
   1750  * This request must not respond until the new operator is selected
   1751  * and registered
   1752  *
   1753  * Valid errors:
   1754  *  SUCCESS
   1755  *  RADIO_NOT_AVAILABLE
   1756  *  ILLEGAL_SIM_OR_ME
   1757  *  GENERIC_FAILURE
   1758  *
   1759  * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and
   1760  *       no retries needed, such as illegal SIM or ME.
   1761  *       Returns GENERIC_FAILURE for all other causes that might be
   1762  *       fixed by retries.
   1763  *
   1764  */
   1765 #define RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC 46
   1766 
   1767 /**
   1768  * RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL
   1769  *
   1770  * Manually select a specified network.
   1771  *
   1772  * "data" is const char * specifying MCCMNC of network to select (eg "310170")
   1773  * "response" is NULL
   1774  *
   1775  * This request must not respond until the new operator is selected
   1776  * and registered
   1777  *
   1778  * Valid errors:
   1779  *  SUCCESS
   1780  *  RADIO_NOT_AVAILABLE
   1781  *  ILLEGAL_SIM_OR_ME
   1782  *  GENERIC_FAILURE
   1783  *
   1784  * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and
   1785  *       no retries needed, such as illegal SIM or ME.
   1786  *       Returns GENERIC_FAILURE for all other causes that might be
   1787  *       fixed by retries.
   1788  *
   1789  */
   1790 #define RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL 47
   1791 
   1792 /**
   1793  * RIL_REQUEST_QUERY_AVAILABLE_NETWORKS
   1794  *
   1795  * Scans for available networks
   1796  *
   1797  * "data" is NULL
   1798  * "response" is const char ** that should be an array of n*4 strings, where
   1799  *    n is the number of available networks
   1800  * For each available network:
   1801  *
   1802  * ((const char **)response)[n+0] is long alpha ONS or EONS
   1803  * ((const char **)response)[n+1] is short alpha ONS or EONS
   1804  * ((const char **)response)[n+2] is 5 or 6 digit numeric code (MCC + MNC)
   1805  * ((const char **)response)[n+3] is a string value of the status:
   1806  *           "unknown"
   1807  *           "available"
   1808  *           "current"
   1809  *           "forbidden"
   1810  *
   1811  * This request must not respond until the new operator is selected
   1812  * and registered
   1813  *
   1814  * Valid errors:
   1815  *  SUCCESS
   1816  *  RADIO_NOT_AVAILABLE
   1817  *  GENERIC_FAILURE
   1818  *
   1819  */
   1820 #define RIL_REQUEST_QUERY_AVAILABLE_NETWORKS 48
   1821 
   1822 /**
   1823  * RIL_REQUEST_DTMF_START
   1824  *
   1825  * Start playing a DTMF tone. Continue playing DTMF tone until
   1826  * RIL_REQUEST_DTMF_STOP is received
   1827  *
   1828  * If a RIL_REQUEST_DTMF_START is received while a tone is currently playing,
   1829  * it should cancel the previous tone and play the new one.
   1830  *
   1831  * "data" is a char *
   1832  * ((char *)data)[0] is a single character with one of 12 values: 0-9,*,#
   1833  * "response" is NULL
   1834  *
   1835  * Valid errors:
   1836  *  SUCCESS
   1837  *  RADIO_NOT_AVAILABLE
   1838  *  GENERIC_FAILURE
   1839  *
   1840  * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_STOP
   1841  */
   1842 #define RIL_REQUEST_DTMF_START 49
   1843 
   1844 /**
   1845  * RIL_REQUEST_DTMF_STOP
   1846  *
   1847  * Stop playing a currently playing DTMF tone.
   1848  *
   1849  * "data" is NULL
   1850  * "response" is NULL
   1851  *
   1852  * Valid errors:
   1853  *  SUCCESS
   1854  *  RADIO_NOT_AVAILABLE
   1855  *  GENERIC_FAILURE
   1856  *
   1857  * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_START
   1858  */
   1859 #define RIL_REQUEST_DTMF_STOP 50
   1860 
   1861 /**
   1862  * RIL_REQUEST_BASEBAND_VERSION
   1863  *
   1864  * Return string value indicating baseband version, eg
   1865  * response from AT+CGMR
   1866  *
   1867  * "data" is NULL
   1868  * "response" is const char * containing version string for log reporting
   1869  *
   1870  * Valid errors:
   1871  *  SUCCESS
   1872  *  RADIO_NOT_AVAILABLE
   1873  *  GENERIC_FAILURE
   1874  *
   1875  */
   1876 #define RIL_REQUEST_BASEBAND_VERSION 51
   1877 
   1878 /**
   1879  * RIL_REQUEST_SEPARATE_CONNECTION
   1880  *
   1881  * Separate a party from a multiparty call placing the multiparty call
   1882  * (less the specified party) on hold and leaving the specified party
   1883  * as the only other member of the current (active) call
   1884  *
   1885  * Like AT+CHLD=2x
   1886  *
   1887  * See TS 22.084 1.3.8.2 (iii)
   1888  * TS 22.030 6.5.5 "Entering "2X followed by send"
   1889  * TS 27.007 "AT+CHLD=2x"
   1890  *
   1891  * "data" is an int *
   1892  * (int *)data)[0] contains Connection index (value of 'x' in CHLD above) "response" is NULL
   1893  *
   1894  * "response" is NULL
   1895  *
   1896  * Valid errors:
   1897  *  SUCCESS
   1898  *  RADIO_NOT_AVAILABLE (radio resetting)
   1899  *  GENERIC_FAILURE
   1900  */
   1901 #define RIL_REQUEST_SEPARATE_CONNECTION 52
   1902 
   1903 
   1904 /**
   1905  * RIL_REQUEST_SET_MUTE
   1906  *
   1907  * Turn on or off uplink (microphone) mute.
   1908  *
   1909  * Will only be sent while voice call is active.
   1910  * Will always be reset to "disable mute" when a new voice call is initiated
   1911  *
   1912  * "data" is an int *
   1913  * (int *)data)[0] is 1 for "enable mute" and 0 for "disable mute"
   1914  *
   1915  * "response" is NULL
   1916  *
   1917  * Valid errors:
   1918  *  SUCCESS
   1919  *  RADIO_NOT_AVAILABLE (radio resetting)
   1920  *  GENERIC_FAILURE
   1921  */
   1922 
   1923 #define RIL_REQUEST_SET_MUTE 53
   1924 
   1925 /**
   1926  * RIL_REQUEST_GET_MUTE
   1927  *
   1928  * Queries the current state of the uplink mute setting
   1929  *
   1930  * "data" is NULL
   1931  * "response" is an int *
   1932  * (int *)response)[0] is 1 for "mute enabled" and 0 for "mute disabled"
   1933  *
   1934  * Valid errors:
   1935  *  SUCCESS
   1936  *  RADIO_NOT_AVAILABLE (radio resetting)
   1937  *  GENERIC_FAILURE
   1938  */
   1939 
   1940 #define RIL_REQUEST_GET_MUTE 54
   1941 
   1942 /**
   1943  * RIL_REQUEST_QUERY_CLIP
   1944  *
   1945  * Queries the status of the CLIP supplementary service
   1946  *
   1947  * (for MMI code "*#30#")
   1948  *
   1949  * "data" is NULL
   1950  * "response" is an int *
   1951  * (int *)response)[0] is 1 for "CLIP provisioned"
   1952  *                           and 0 for "CLIP not provisioned"
   1953  *                           and 2 for "unknown, e.g. no network etc"
   1954  *
   1955  * Valid errors:
   1956  *  SUCCESS
   1957  *  RADIO_NOT_AVAILABLE (radio resetting)
   1958  *  GENERIC_FAILURE
   1959  */
   1960 
   1961 #define RIL_REQUEST_QUERY_CLIP 55
   1962 
   1963 /**
   1964  * RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE
   1965  *
   1966  * Requests the failure cause code for the most recently failed PDP
   1967  * context or CDMA data connection active
   1968  * replaces RIL_REQUEST_LAST_PDP_FAIL_CAUSE
   1969  *
   1970  * "data" is NULL
   1971  *
   1972  * "response" is a "int *"
   1973  * ((int *)response)[0] is an integer cause code defined in TS 24.008
   1974  *   section 6.1.3.1.3 or close approximation
   1975  *
   1976  * If the implementation does not have access to the exact cause codes,
   1977  * then it should return one of the values listed in
   1978  * RIL_LastDataCallActivateFailCause, as the UI layer needs to distinguish these
   1979  * cases for error notification
   1980  * and potential retries.
   1981  *
   1982  * Valid errors:
   1983  *  SUCCESS
   1984  *  RADIO_NOT_AVAILABLE
   1985  *  GENERIC_FAILURE
   1986  *
   1987  * See also: RIL_REQUEST_LAST_CALL_FAIL_CAUSE
   1988  *
   1989  */
   1990 
   1991 #define RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE 56
   1992 
   1993 /**
   1994  * RIL_REQUEST_DATA_CALL_LIST
   1995  *
   1996  * Queries the status of PDP contexts, returning for each
   1997  * its CID, whether or not it is active, and its PDP type,
   1998  * APN, and PDP adddress.
   1999  * replaces RIL_REQUEST_PDP_CONTEXT_LIST
   2000  *
   2001  * "data" is NULL
   2002  * "response" is an array of RIL_Data_Call_Response
   2003  *
   2004  * Valid errors:
   2005  *  SUCCESS
   2006  *  RADIO_NOT_AVAILABLE (radio resetting)
   2007  *  GENERIC_FAILURE
   2008  */
   2009 
   2010 #define RIL_REQUEST_DATA_CALL_LIST 57
   2011 
   2012 /**
   2013  * RIL_REQUEST_RESET_RADIO - DEPRECATED
   2014  *
   2015  * Request a radio reset. The RIL implementation may postpone
   2016  * the reset until after this request is responded to if the baseband
   2017  * is presently busy.
   2018  *
   2019  * The request is DEPRECATED, use RIL_REQUEST_RADIO_POWER
   2020  *
   2021  * "data" is NULL
   2022  * "response" is NULL
   2023  *
   2024  * Valid errors:
   2025  *  SUCCESS
   2026  *  RADIO_NOT_AVAILABLE (radio resetting)
   2027  *  GENERIC_FAILURE
   2028  *  REQUEST_NOT_SUPPORTED
   2029  */
   2030 
   2031 #define RIL_REQUEST_RESET_RADIO 58
   2032 
   2033 /**
   2034  * RIL_REQUEST_OEM_HOOK_RAW
   2035  *
   2036  * This request reserved for OEM-specific uses. It passes raw byte arrays
   2037  * back and forth.
   2038  *
   2039  * It can be invoked on the Java side from
   2040  * com.android.internal.telephony.Phone.invokeOemRilRequestRaw()
   2041  *
   2042  * "data" is a char * of bytes copied from the byte[] data argument in java
   2043  * "response" is a char * of bytes that will returned via the
   2044  * caller's "response" Message here:
   2045  * (byte[])(((AsyncResult)response.obj).result)
   2046  *
   2047  * An error response here will result in
   2048  * (((AsyncResult)response.obj).result) == null and
   2049  * (((AsyncResult)response.obj).exception) being an instance of
   2050  * com.android.internal.telephony.gsm.CommandException
   2051  *
   2052  * Valid errors:
   2053  *  All
   2054  */
   2055 
   2056 #define RIL_REQUEST_OEM_HOOK_RAW 59
   2057 
   2058 /**
   2059  * RIL_REQUEST_OEM_HOOK_STRINGS
   2060  *
   2061  * This request reserved for OEM-specific uses. It passes strings
   2062  * back and forth.
   2063  *
   2064  * It can be invoked on the Java side from
   2065  * com.android.internal.telephony.Phone.invokeOemRilRequestStrings()
   2066  *
   2067  * "data" is a const char **, representing an array of null-terminated UTF-8
   2068  * strings copied from the "String[] strings" argument to
   2069  * invokeOemRilRequestStrings()
   2070  *
   2071  * "response" is a const char **, representing an array of null-terminated UTF-8
   2072  * stings that will be returned via the caller's response message here:
   2073  *
   2074  * (String[])(((AsyncResult)response.obj).result)
   2075  *
   2076  * An error response here will result in
   2077  * (((AsyncResult)response.obj).result) == null and
   2078  * (((AsyncResult)response.obj).exception) being an instance of
   2079  * com.android.internal.telephony.gsm.CommandException
   2080  *
   2081  * Valid errors:
   2082  *  All
   2083  */
   2084 
   2085 #define RIL_REQUEST_OEM_HOOK_STRINGS 60
   2086 
   2087 /**
   2088  * RIL_REQUEST_SCREEN_STATE
   2089  *
   2090  * Indicates the current state of the screen.  When the screen is off, the
   2091  * RIL should notify the baseband to suppress certain notifications (eg,
   2092  * signal strength and changes in LAC/CID or BID/SID/NID/latitude/longitude)
   2093  * in an effort to conserve power.  These notifications should resume when the
   2094  * screen is on.
   2095  *
   2096  * "data" is int *
   2097  * ((int *)data)[0] is == 1 for "Screen On"
   2098  * ((int *)data)[0] is == 0 for "Screen Off"
   2099  *
   2100  * "response" is NULL
   2101  *
   2102  * Valid errors:
   2103  *  SUCCESS
   2104  *  GENERIC_FAILURE
   2105  */
   2106 #define RIL_REQUEST_SCREEN_STATE 61
   2107 
   2108 
   2109 /**
   2110  * RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION
   2111  *
   2112  * Enables/disables supplementary service related notifications
   2113  * from the network.
   2114  *
   2115  * Notifications are reported via RIL_UNSOL_SUPP_SVC_NOTIFICATION.
   2116  *
   2117  * "data" is int *
   2118  * ((int *)data)[0] is == 1 for notifications enabled
   2119  * ((int *)data)[0] is == 0 for notifications disabled
   2120  *
   2121  * "response" is NULL
   2122  *
   2123  * Valid errors:
   2124  *  SUCCESS
   2125  *  RADIO_NOT_AVAILABLE
   2126  *  GENERIC_FAILURE
   2127  *
   2128  * See also: RIL_UNSOL_SUPP_SVC_NOTIFICATION.
   2129  */
   2130 #define RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION 62
   2131 
   2132 /**
   2133  * RIL_REQUEST_WRITE_SMS_TO_SIM
   2134  *
   2135  * Stores a SMS message to SIM memory.
   2136  *
   2137  * "data" is RIL_SMS_WriteArgs *
   2138  *
   2139  * "response" is int *
   2140  * ((const int *)response)[0] is the record index where the message is stored.
   2141  *
   2142  * Valid errors:
   2143  *  SUCCESS
   2144  *  GENERIC_FAILURE
   2145  *
   2146  */
   2147 #define RIL_REQUEST_WRITE_SMS_TO_SIM 63
   2148 
   2149 /**
   2150  * RIL_REQUEST_DELETE_SMS_ON_SIM
   2151  *
   2152  * Deletes a SMS message from SIM memory.
   2153  *
   2154  * "data" is int  *
   2155  * ((int *)data)[0] is the record index of the message to delete.
   2156  *
   2157  * "response" is NULL
   2158  *
   2159  * Valid errors:
   2160  *  SUCCESS
   2161  *  GENERIC_FAILURE
   2162  *
   2163  */
   2164 #define RIL_REQUEST_DELETE_SMS_ON_SIM 64
   2165 
   2166 /**
   2167  * RIL_REQUEST_SET_BAND_MODE
   2168  *
   2169  * Assign a specified band for RF configuration.
   2170  *
   2171  * "data" is int *
   2172  * ((int *)data)[0] is == 0 for "unspecified" (selected by baseband automatically)
   2173  * ((int *)data)[0] is == 1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
   2174  * ((int *)data)[0] is == 2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
   2175  * ((int *)data)[0] is == 3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
   2176  * ((int *)data)[0] is == 4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
   2177  * ((int *)data)[0] is == 5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
   2178  * ((int *)data)[0] is == 6 for "Cellular (800-MHz Band)"
   2179  * ((int *)data)[0] is == 7 for "PCS (1900-MHz Band)"
   2180  * ((int *)data)[0] is == 8 for "Band Class 3 (JTACS Band)"
   2181  * ((int *)data)[0] is == 9 for "Band Class 4 (Korean PCS Band)"
   2182  * ((int *)data)[0] is == 10 for "Band Class 5 (450-MHz Band)"
   2183  * ((int *)data)[0] is == 11 for "Band Class 6 (2-GMHz IMT2000 Band)"
   2184  * ((int *)data)[0] is == 12 for "Band Class 7 (Upper 700-MHz Band)"
   2185  * ((int *)data)[0] is == 13 for "Band Class 8 (1800-MHz Band)"
   2186  * ((int *)data)[0] is == 14 for "Band Class 9 (900-MHz Band)"
   2187  * ((int *)data)[0] is == 15 for "Band Class 10 (Secondary 800-MHz Band)"
   2188  * ((int *)data)[0] is == 16 for "Band Class 11 (400-MHz European PAMR Band)"
   2189  * ((int *)data)[0] is == 17 for "Band Class 15 (AWS Band)"
   2190  * ((int *)data)[0] is == 18 for "Band Class 16 (US 2.5-GHz Band)"
   2191  *
   2192  * "response" is NULL
   2193  *
   2194  * Valid errors:
   2195  *  SUCCESS
   2196  *  RADIO_NOT_AVAILABLE
   2197  *  GENERIC_FAILURE
   2198  */
   2199 #define RIL_REQUEST_SET_BAND_MODE 65
   2200 
   2201 /**
   2202  * RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE
   2203  *
   2204  * Query the list of band mode supported by RF.
   2205  *
   2206  * "data" is NULL
   2207  *
   2208  * "response" is int *
   2209  * "response" points to an array of int's, the int[0] is the size of array, reset is one for
   2210  * each available band mode.
   2211  *
   2212  *  0 for "unspecified" (selected by baseband automatically)
   2213  *  1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
   2214  *  2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
   2215  *  3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
   2216  *  4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
   2217  *  5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
   2218  *  6 for "Cellular (800-MHz Band)"
   2219  *  7 for "PCS (1900-MHz Band)"
   2220  *  8 for "Band Class 3 (JTACS Band)"
   2221  *  9 for "Band Class 4 (Korean PCS Band)"
   2222  *  10 for "Band Class 5 (450-MHz Band)"
   2223  *  11 for "Band Class 6 (2-GMHz IMT2000 Band)"
   2224  *  12 for "Band Class 7 (Upper 700-MHz Band)"
   2225  *  13 for "Band Class 8 (1800-MHz Band)"
   2226  *  14 for "Band Class 9 (900-MHz Band)"
   2227  *  15 for "Band Class 10 (Secondary 800-MHz Band)"
   2228  *  16 for "Band Class 11 (400-MHz European PAMR Band)"
   2229  *  17 for "Band Class 15 (AWS Band)"
   2230  *  18 for "Band Class 16 (US 2.5-GHz Band)"
   2231  *
   2232  * Valid errors:
   2233  *  SUCCESS
   2234  *  RADIO_NOT_AVAILABLE
   2235  *  GENERIC_FAILURE
   2236  *
   2237  * See also: RIL_REQUEST_SET_BAND_MODE
   2238  */
   2239 #define RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE 66
   2240 
   2241 /**
   2242  * RIL_REQUEST_STK_GET_PROFILE
   2243  *
   2244  * Requests the profile of SIM tool kit.
   2245  * The profile indicates the SAT/USAT features supported by ME.
   2246  * The SAT/USAT features refer to 3GPP TS 11.14 and 3GPP TS 31.111
   2247  *
   2248  * "data" is NULL
   2249  *
   2250  * "response" is a const char * containing SAT/USAT profile
   2251  * in hexadecimal format string starting with first byte of terminal profile
   2252  *
   2253  * Valid errors:
   2254  *  RIL_E_SUCCESS
   2255  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
   2256  *  RIL_E_GENERIC_FAILURE
   2257  */
   2258 #define RIL_REQUEST_STK_GET_PROFILE 67
   2259 
   2260 /**
   2261  * RIL_REQUEST_STK_SET_PROFILE
   2262  *
   2263  * Download the STK terminal profile as part of SIM initialization
   2264  * procedure
   2265  *
   2266  * "data" is a const char * containing SAT/USAT profile
   2267  * in hexadecimal format string starting with first byte of terminal profile
   2268  *
   2269  * "response" is NULL
   2270  *
   2271  * Valid errors:
   2272  *  RIL_E_SUCCESS
   2273  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
   2274  *  RIL_E_GENERIC_FAILURE
   2275  */
   2276 #define RIL_REQUEST_STK_SET_PROFILE 68
   2277 
   2278 /**
   2279  * RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND
   2280  *
   2281  * Requests to send a SAT/USAT envelope command to SIM.
   2282  * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111
   2283  *
   2284  * "data" is a const char * containing SAT/USAT command
   2285  * in hexadecimal format string starting with command tag
   2286  *
   2287  * "response" is a const char * containing SAT/USAT response
   2288  * in hexadecimal format string starting with first byte of response
   2289  * (May be NULL)
   2290  *
   2291  * Valid errors:
   2292  *  RIL_E_SUCCESS
   2293  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
   2294  *  RIL_E_GENERIC_FAILURE
   2295  */
   2296 #define RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND 69
   2297 
   2298 /**
   2299  * RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE
   2300  *
   2301  * Requests to send a terminal response to SIM for a received
   2302  * proactive command
   2303  *
   2304  * "data" is a const char * containing SAT/USAT response
   2305  * in hexadecimal format string starting with first byte of response data
   2306  *
   2307  * "response" is NULL
   2308  *
   2309  * Valid errors:
   2310  *  RIL_E_SUCCESS
   2311  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
   2312  *  RIL_E_GENERIC_FAILURE
   2313  */
   2314 #define RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE 70
   2315 
   2316 /**
   2317  * RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM
   2318  *
   2319  * When STK application gets RIL_UNSOL_STK_CALL_SETUP, the call actually has
   2320  * been initialized by ME already. (We could see the call has been in the 'call
   2321  * list') So, STK application needs to accept/reject the call according as user
   2322  * operations.
   2323  *
   2324  * "data" is int *
   2325  * ((int *)data)[0] is > 0 for "accept" the call setup
   2326  * ((int *)data)[0] is == 0 for "reject" the call setup
   2327  *
   2328  * "response" is NULL
   2329  *
   2330  * Valid errors:
   2331  *  RIL_E_SUCCESS
   2332  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
   2333  *  RIL_E_GENERIC_FAILURE
   2334  */
   2335 #define RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM 71
   2336 
   2337 /**
   2338  * RIL_REQUEST_EXPLICIT_CALL_TRANSFER
   2339  *
   2340  * Connects the two calls and disconnects the subscriber from both calls.
   2341  *
   2342  * "data" is NULL
   2343  * "response" is NULL
   2344  *
   2345  * Valid errors:
   2346  *  SUCCESS
   2347  *  RADIO_NOT_AVAILABLE (radio resetting)
   2348  *  GENERIC_FAILURE
   2349  */
   2350 #define RIL_REQUEST_EXPLICIT_CALL_TRANSFER 72
   2351 
   2352 /**
   2353  * RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
   2354  *
   2355  * Requests to set the preferred network type for searching and registering
   2356  * (CS/PS domain, RAT, and operation mode)
   2357  *
   2358  * "data" is int *
   2359  *
   2360  * ((int *)data)[0] is == 0 for GSM/WCDMA (WCDMA preferred)
   2361  * ((int *)data)[0] is == 1 for GSM only
   2362  * ((int *)data)[0] is == 2 for WCDMA only
   2363  * ((int *)data)[0] is == 3 for GSM/WCDMA (auto mode, according to PRL)
   2364  * ((int *)data)[0] is == 4 for CDMA and EvDo (auto mode, according to PRL)
   2365  * ((int *)data)[0] is == 5 for CDMA only
   2366  * ((int *)data)[0] is == 6 for EvDo only
   2367  * ((int *)data)[0] is == 7 for GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL)
   2368  *
   2369  * "response" is NULL
   2370  *
   2371  * Valid errors:
   2372  *  SUCCESS
   2373  *  RADIO_NOT_AVAILABLE (radio resetting)
   2374  *  GENERIC_FAILURE
   2375  *  MODE_NOT_SUPPORTED
   2376  */
   2377 #define RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE 73
   2378 
   2379 /**
   2380  * RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE
   2381  *
   2382  * Query the preferred network type (CS/PS domain, RAT, and operation mode)
   2383  * for searching and registering
   2384  *
   2385  * "data" is NULL
   2386  *
   2387  * "response" is int *
   2388  * ((int *)response)[0] is == 0 for GSM/WCDMA (WCDMA preferred)
   2389  * ((int *)response)[0] is == 1 for GSM only
   2390  * ((int *)response)[0] is == 2 for WCDMA only
   2391  * ((int *)response)[0] is == 3 for GSM/WCDMA (auto mode, according to PRL)
   2392  * ((int *)response)[0] is == 4 for CDMA and EvDo (auto mode, according to PRL)
   2393  * ((int *)response)[0] is == 5 for CDMA only
   2394  * ((int *)response)[0] is == 6 for EvDo only
   2395  * ((int *)response)[0] is == 7 for GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL)
   2396  *
   2397  * Valid errors:
   2398  *  SUCCESS
   2399  *  RADIO_NOT_AVAILABLE
   2400  *  GENERIC_FAILURE
   2401  *
   2402  * See also: RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
   2403  */
   2404 #define RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE 74
   2405 
   2406 /**
   2407  * RIL_REQUEST_NEIGHBORING_CELL_IDS
   2408  *
   2409  * Request neighboring cell id in GSM network
   2410  *
   2411  * "data" is NULL
   2412  * "response" must be a " const RIL_NeighboringCell** "
   2413  *
   2414  * Valid errors:
   2415  *  SUCCESS
   2416  *  RADIO_NOT_AVAILABLE
   2417  *  GENERIC_FAILURE
   2418  */
   2419 #define RIL_REQUEST_GET_NEIGHBORING_CELL_IDS 75
   2420 
   2421 /**
   2422  * RIL_REQUEST_SET_LOCATION_UPDATES
   2423  *
   2424  * Enables/disables network state change notifications due to changes in
   2425  * LAC and/or CID (for GSM) or BID/SID/NID/latitude/longitude (for CDMA).
   2426  * Basically +CREG=2 vs. +CREG=1 (TS 27.007).
   2427  *
   2428  * Note:  The RIL implementation should default to "updates enabled"
   2429  * when the screen is on and "updates disabled" when the screen is off.
   2430  *
   2431  * "data" is int *
   2432  * ((int *)data)[0] is == 1 for updates enabled (+CREG=2)
   2433  * ((int *)data)[0] is == 0 for updates disabled (+CREG=1)
   2434  *
   2435  * "response" is NULL
   2436  *
   2437  * Valid errors:
   2438  *  SUCCESS
   2439  *  RADIO_NOT_AVAILABLE
   2440  *  GENERIC_FAILURE
   2441  *
   2442  * See also: RIL_REQUEST_SCREEN_STATE, RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED
   2443  */
   2444 #define RIL_REQUEST_SET_LOCATION_UPDATES 76
   2445 
   2446 /**
   2447  * RIL_REQUEST_CDMA_SET_SUBSCRIPTION
   2448  *
   2449  * Request to set the location where the CDMA subscription shall
   2450  * be retrieved
   2451  *
   2452  * "data" is int *
   2453  * ((int *)data)[0] is == 0 from RUIM/SIM (default)
   2454  * ((int *)data)[0] is == 1 from NV
   2455  *
   2456  * "response" is NULL
   2457  *
   2458  * Valid errors:
   2459  *  SUCCESS
   2460  *  RADIO_NOT_AVAILABLE
   2461  *  GENERIC_FAILURE
   2462  *  SIM_ABSENT
   2463  *  SUBSCRIPTION_NOT_AVAILABLE
   2464  */
   2465 #define RIL_REQUEST_CDMA_SET_SUBSCRIPTION 77
   2466 
   2467 /**
   2468  * RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE
   2469  *
   2470  * Request to set the roaming preferences in CDMA
   2471  *
   2472  * "data" is int *
   2473  * ((int *)data)[0] is == 0 for Home Networks only, as defined in PRL
   2474  * ((int *)data)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL
   2475  * ((int *)data)[0] is == 2 for Roaming on Any Network, as defined in the PRL
   2476  *
   2477  * "response" is NULL
   2478  *
   2479  * Valid errors:
   2480  *  SUCCESS
   2481  *  RADIO_NOT_AVAILABLE
   2482  *  GENERIC_FAILURE
   2483  */
   2484 #define RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE 78
   2485 
   2486 /**
   2487  * RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE
   2488  *
   2489  * Request the actual setting of the roaming preferences in CDMA in the modem
   2490  *
   2491  * "data" is NULL
   2492  *
   2493  * "response" is int *
   2494  * ((int *)response)[0] is == 0 for Home Networks only, as defined in PRL
   2495  * ((int *)response)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL
   2496  * ((int *)response)[0] is == 2 for Roaming on Any Network, as defined in the PRL
   2497  *
   2498  * "response" is NULL
   2499  *
   2500  * Valid errors:
   2501  *  SUCCESS
   2502  *  RADIO_NOT_AVAILABLE
   2503  *  GENERIC_FAILURE
   2504  */
   2505 #define RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE 79
   2506 
   2507 /**
   2508  * RIL_REQUEST_SET_TTY_MODE
   2509  *
   2510  * Request to set the TTY mode
   2511  *
   2512  * "data" is int *
   2513  * ((int *)data)[0] is == 0 for TTY off
   2514  * ((int *)data)[0] is == 1 for TTY Full
   2515  * ((int *)data)[0] is == 2 for TTY HCO (hearing carryover)
   2516  * ((int *)data)[0] is == 3 for TTY VCO (voice carryover)
   2517  *
   2518  * "response" is NULL
   2519  *
   2520  * Valid errors:
   2521  *  SUCCESS
   2522  *  RADIO_NOT_AVAILABLE
   2523  *  GENERIC_FAILURE
   2524  */
   2525 #define RIL_REQUEST_SET_TTY_MODE 80
   2526 
   2527 /**
   2528  * RIL_REQUEST_QUERY_TTY_MODE
   2529  *
   2530  * Request the setting of TTY mode
   2531  *
   2532  * "data" is NULL
   2533  *
   2534  * "response" is int *
   2535  * ((int *)response)[0] is == 0 for TTY off
   2536  * ((int *)response)[0] is == 1 for TTY Full
   2537  * ((int *)response)[0] is == 2 for TTY HCO (hearing carryover)
   2538  * ((int *)response)[0] is == 3 for TTY VCO (voice carryover)
   2539  *
   2540  * "response" is NULL
   2541  *
   2542  * Valid errors:
   2543  *  SUCCESS
   2544  *  RADIO_NOT_AVAILABLE
   2545  *  GENERIC_FAILURE
   2546  */
   2547 #define RIL_REQUEST_QUERY_TTY_MODE 81
   2548 
   2549 /**
   2550  * RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE
   2551  *
   2552  * Request to set the preferred voice privacy mode used in voice
   2553  * scrambling
   2554  *
   2555  * "data" is int *
   2556  * ((int *)data)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask)
   2557  * ((int *)data)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask)
   2558  *
   2559  * "response" is NULL
   2560  *
   2561  * Valid errors:
   2562  *  SUCCESS
   2563  *  RADIO_NOT_AVAILABLE
   2564  *  GENERIC_FAILURE
   2565  */
   2566 #define RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE 82
   2567 
   2568 /**
   2569  * RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE
   2570  *
   2571  * Request the setting of preferred voice privacy mode
   2572  *
   2573  * "data" is NULL
   2574  *
   2575  * "response" is int *
   2576  * ((int *)response)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask)
   2577  * ((int *)response)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask)
   2578  *
   2579  * "response" is NULL
   2580  *
   2581  * Valid errors:
   2582  *  SUCCESS
   2583  *  RADIO_NOT_AVAILABLE
   2584  *  GENERIC_FAILURE
   2585  */
   2586 #define RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE 83
   2587 
   2588 /**
   2589  * RIL_REQUEST_CDMA_FLASH
   2590  *
   2591  * Send FLASH
   2592  *
   2593  * "data" is const char *
   2594  * ((const char *)data)[0] is a FLASH string
   2595  *
   2596  * "response" is NULL
   2597  *
   2598  * Valid errors:
   2599  *  SUCCESS
   2600  *  RADIO_NOT_AVAILABLE
   2601  *  GENERIC_FAILURE
   2602  *
   2603  */
   2604 #define RIL_REQUEST_CDMA_FLASH 84
   2605 
   2606 /**
   2607  * RIL_REQUEST_CDMA_BURST_DTMF
   2608  *
   2609  * Send DTMF string
   2610  *
   2611  * "data" is const char **
   2612  * ((const char **)data)[0] is a DTMF string
   2613  * ((const char **)data)[1] is the DTMF ON length in milliseconds, or 0 to use
   2614  *                          default
   2615  * ((const char **)data)[2] is the DTMF OFF length in milliseconds, or 0 to use
   2616  *                          default
   2617  *
   2618  * "response" is NULL
   2619  *
   2620  * Valid errors:
   2621  *  SUCCESS
   2622  *  RADIO_NOT_AVAILABLE
   2623  *  GENERIC_FAILURE
   2624  *
   2625  */
   2626 #define RIL_REQUEST_CDMA_BURST_DTMF 85
   2627 
   2628 /**
   2629  * RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY
   2630  *
   2631  * Takes a 26 digit string (20 digit AKEY + 6 digit checksum).
   2632  * If the checksum is valid the 20 digit AKEY is written to NV,
   2633  * replacing the existing AKEY no matter what it was before.
   2634  *
   2635  * "data" is const char *
   2636  * ((const char *)data)[0] is a 26 digit string (ASCII digits '0'-'9')
   2637  *                         where the last 6 digits are a checksum of the
   2638  *                         first 20, as specified in TR45.AHAG
   2639  *                         "Common Cryptographic Algorithms, Revision D.1
   2640  *                         Section 2.2"
   2641  *
   2642  * "response" is NULL
   2643  *
   2644  * Valid errors:
   2645  *  SUCCESS
   2646  *  RADIO_NOT_AVAILABLE
   2647  *  GENERIC_FAILURE
   2648  *
   2649  */
   2650 #define RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY 86
   2651 
   2652 /**
   2653  * RIL_REQUEST_CDMA_SEND_SMS
   2654  *
   2655  * Send a CDMA SMS message
   2656  *
   2657  * "data" is const RIL_CDMA_SMS_Message *
   2658  *
   2659  * "response" is a const RIL_SMS_Response *
   2660  *
   2661  * Based on the return error, caller decides to resend if sending sms
   2662  * fails. The CDMA error class is derived as follows,
   2663  * SUCCESS is error class 0 (no error)
   2664  * SMS_SEND_FAIL_RETRY is error class 2 (temporary failure)
   2665  * and GENERIC_FAILURE is error class 3 (permanent and no retry)
   2666  *
   2667  * Valid errors:
   2668  *  SUCCESS
   2669  *  RADIO_NOT_AVAILABLE
   2670  *  SMS_SEND_FAIL_RETRY
   2671  *  GENERIC_FAILURE
   2672  *
   2673  */
   2674 #define RIL_REQUEST_CDMA_SEND_SMS 87
   2675 
   2676 /**
   2677  * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE
   2678  *
   2679  * Acknowledge the success or failure in the receipt of SMS
   2680  * previously indicated via RIL_UNSOL_RESPONSE_CDMA_NEW_SMS
   2681  *
   2682  * "data" is const RIL_CDMA_SMS_Ack *
   2683  *
   2684  * "response" is NULL
   2685  *
   2686  * Valid errors:
   2687  *  SUCCESS
   2688  *  RADIO_NOT_AVAILABLE
   2689  *  GENERIC_FAILURE
   2690  *
   2691  */
   2692 #define RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE 88
   2693 
   2694 /**
   2695  * RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG
   2696  *
   2697  * Request the setting of GSM/WCDMA Cell Broadcast SMS config.
   2698  *
   2699  * "data" is NULL
   2700  *
   2701  * "response" is a const RIL_GSM_BroadcastSmsConfigInfo **
   2702  * "responselen" is count * sizeof (RIL_GSM_BroadcastSmsConfigInfo *)
   2703  *
   2704  * Valid errors:
   2705  *  SUCCESS
   2706  *  RADIO_NOT_AVAILABLE
   2707  *  GENERIC_FAILURE
   2708  *
   2709  */
   2710 #define RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG 89
   2711 
   2712 /**
   2713  * RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG
   2714  *
   2715  * Set GSM/WCDMA Cell Broadcast SMS config
   2716  *
   2717  * "data" is a const RIL_GSM_BroadcastSmsConfigInfo **
   2718  * "datalen" is count * sizeof(RIL_GSM_BroadcastSmsConfigInfo *)
   2719  *
   2720  * "response" is NULL
   2721  *
   2722  * Valid errors:
   2723  *  SUCCESS
   2724  *  RADIO_NOT_AVAILABLE
   2725  *  GENERIC_FAILURE
   2726  *
   2727  */
   2728 #define RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG 90
   2729 
   2730 /**
   2731  * RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION
   2732  *
   2733 * Enable or disable the reception of GSM/WCDMA Cell Broadcast SMS
   2734  *
   2735  * "data" is const int *
   2736  * (const int *)data[0] indicates to activate or turn off the
   2737  * reception of GSM/WCDMA Cell Broadcast SMS, 0-1,
   2738  *                       0 - Activate, 1 - Turn off
   2739  *
   2740  * "response" is NULL
   2741  *
   2742  * Valid errors:
   2743  *  SUCCESS
   2744  *  RADIO_NOT_AVAILABLE
   2745  *  GENERIC_FAILURE
   2746  *
   2747  */
   2748 #define RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION 91
   2749 
   2750 /**
   2751  * RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG
   2752  *
   2753  * Request the setting of CDMA Broadcast SMS config
   2754  *
   2755  * "data" is NULL
   2756  *
   2757  * "response" is a const RIL_CDMA_BroadcastSmsConfigInfo **
   2758  * "responselen" is count * sizeof (RIL_CDMA_BroadcastSmsConfigInfo *)
   2759  *
   2760  * Valid errors:
   2761  *  SUCCESS
   2762  *  RADIO_NOT_AVAILABLE
   2763  *  GENERIC_FAILURE
   2764  *
   2765  */
   2766 #define RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG 92
   2767 
   2768 /**
   2769  * RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG
   2770  *
   2771  * Set CDMA Broadcast SMS config
   2772  *
   2773  * "data" is an const RIL_CDMA_BroadcastSmsConfigInfo **
   2774  * "datalen" is count * sizeof(const RIL_CDMA_BroadcastSmsConfigInfo *)
   2775  *
   2776  * "response" is NULL
   2777  *
   2778  * Valid errors:
   2779  *  SUCCESS
   2780  *  RADIO_NOT_AVAILABLE
   2781  *  GENERIC_FAILURE
   2782  *
   2783  */
   2784 #define RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG 93
   2785 
   2786 /**
   2787  * RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION
   2788  *
   2789  * Enable or disable the reception of CDMA Broadcast SMS
   2790  *
   2791  * "data" is const int *
   2792  * (const int *)data[0] indicates to activate or turn off the
   2793  * reception of CDMA Broadcast SMS, 0-1,
   2794  *                       0 - Activate, 1 - Turn off
   2795  *
   2796  * "response" is NULL
   2797  *
   2798  * Valid errors:
   2799  *  SUCCESS
   2800  *  RADIO_NOT_AVAILABLE
   2801  *  GENERIC_FAILURE
   2802  *
   2803  */
   2804 #define RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION 94
   2805 
   2806 /**
   2807  * RIL_REQUEST_CDMA_SUBSCRIPTION
   2808  *
   2809  * Request the device MDN / H_SID / H_NID.
   2810  *
   2811  * The request is only allowed when CDMA subscription is available.  When CDMA
   2812  * subscription is changed, application layer should re-issue the request to
   2813  * update the subscription information.
   2814  *
   2815  * If a NULL value is returned for any of the device id, it means that error
   2816  * accessing the device.
   2817  *
   2818  * "response" is const char **
   2819  * ((const char **)response)[0] is MDN if CDMA subscription is available
   2820  * ((const char **)response)[1] is a comma separated list of H_SID (Home SID) if
   2821  *                              CDMA subscription is available, in decimal format
   2822  * ((const char **)response)[2] is a comma separated list of H_NID (Home NID) if
   2823  *                              CDMA subscription is available, in decimal format
   2824  * ((const char **)response)[3] is MIN (10 digits, MIN2+MIN1) if CDMA subscription is available
   2825  * ((const char **)response)[4] is PRL version if CDMA subscription is available
   2826  *
   2827  * Valid errors:
   2828  *  SUCCESS
   2829  *  RIL_E_SUBSCRIPTION_NOT_AVAILABLE
   2830  */
   2831 
   2832 #define RIL_REQUEST_CDMA_SUBSCRIPTION 95
   2833 
   2834 /**
   2835  * RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM
   2836  *
   2837  * Stores a CDMA SMS message to RUIM memory.
   2838  *
   2839  * "data" is RIL_CDMA_SMS_WriteArgs *
   2840  *
   2841  * "response" is int *
   2842  * ((const int *)response)[0] is the record index where the message is stored.
   2843  *
   2844  * Valid errors:
   2845  *  SUCCESS
   2846  *  RADIO_NOT_AVAILABLE
   2847  *  GENERIC_FAILURE
   2848  *
   2849  */
   2850 #define RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM 96
   2851 
   2852 /**
   2853  * RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM
   2854  *
   2855  * Deletes a CDMA SMS message from RUIM memory.
   2856  *
   2857  * "data" is int  *
   2858  * ((int *)data)[0] is the record index of the message to delete.
   2859  *
   2860  * "response" is NULL
   2861  *
   2862  * Valid errors:
   2863  *  SUCCESS
   2864  *  RADIO_NOT_AVAILABLE
   2865  *  GENERIC_FAILURE
   2866  *
   2867  */
   2868 #define RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM 97
   2869 
   2870 /**
   2871  * RIL_REQUEST_DEVICE_IDENTITY
   2872  *
   2873  * Request the device ESN / MEID / IMEI / IMEISV.
   2874  *
   2875  * The request is always allowed and contains GSM and CDMA device identity;
   2876  * it substitutes the deprecated requests RIL_REQUEST_GET_IMEI and
   2877  * RIL_REQUEST_GET_IMEISV.
   2878  *
   2879  * If a NULL value is returned for any of the device id, it means that error
   2880  * accessing the device.
   2881  *
   2882  * When CDMA subscription is changed the ESN/MEID may change.  The application
   2883  * layer should re-issue the request to update the device identity in this case.
   2884  *
   2885  * "response" is const char **
   2886  * ((const char **)response)[0] is IMEI if GSM subscription is available
   2887  * ((const char **)response)[1] is IMEISV if GSM subscription is available
   2888  * ((const char **)response)[2] is ESN if CDMA subscription is available
   2889  * ((const char **)response)[3] is MEID if CDMA subscription is available
   2890  *
   2891  * Valid errors:
   2892  *  SUCCESS
   2893  *  RADIO_NOT_AVAILABLE
   2894  *  GENERIC_FAILURE
   2895  */
   2896 #define RIL_REQUEST_DEVICE_IDENTITY 98
   2897 
   2898 /**
   2899  * RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE
   2900  *
   2901  * Request the radio's system selection module to exit emergency
   2902  * callback mode.  RIL will not respond with SUCCESS until the modem has
   2903  * completely exited from Emergency Callback Mode.
   2904  *
   2905  * "data" is NULL
   2906  *
   2907  * "response" is NULL
   2908  *
   2909  * Valid errors:
   2910  *  SUCCESS
   2911  *  RADIO_NOT_AVAILABLE
   2912  *  GENERIC_FAILURE
   2913  *
   2914  */
   2915 #define RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE 99
   2916 
   2917 /**
   2918  * RIL_REQUEST_GET_SMSC_ADDRESS
   2919  *
   2920  * Queries the default Short Message Service Center address on the device.
   2921  *
   2922  * "data" is NULL
   2923  *
   2924  * "response" is const char * containing the SMSC address.
   2925  *
   2926  * Valid errors:
   2927  *  SUCCESS
   2928  *  RADIO_NOT_AVAILABLE
   2929  *  GENERIC_FAILURE
   2930  *
   2931  */
   2932 #define RIL_REQUEST_GET_SMSC_ADDRESS 100
   2933 
   2934 /**
   2935  * RIL_REQUEST_SET_SMSC_ADDRESS
   2936  *
   2937  * Sets the default Short Message Service Center address on the device.
   2938  *
   2939  * "data" is const char * containing the SMSC address.
   2940  *
   2941  * "response" is NULL
   2942  *
   2943  * Valid errors:
   2944  *  SUCCESS
   2945  *  RADIO_NOT_AVAILABLE
   2946  *  GENERIC_FAILURE
   2947  *
   2948  */
   2949 #define RIL_REQUEST_SET_SMSC_ADDRESS 101
   2950 
   2951 /**
   2952  * RIL_REQUEST_REPORT_SMS_MEMORY_STATUS
   2953  *
   2954  * Indicates whether there is storage available for new SMS messages.
   2955  *
   2956  * "data" is int *
   2957  * ((int *)data)[0] is 1 if memory is available for storing new messages
   2958  *                  is 0 if memory capacity is exceeded
   2959  *
   2960  * "response" is NULL
   2961  *
   2962  * Valid errors:
   2963  *  SUCCESS
   2964  *  RADIO_NOT_AVAILABLE
   2965  *  GENERIC_FAILURE
   2966  *
   2967  */
   2968 #define RIL_REQUEST_REPORT_SMS_MEMORY_STATUS 102
   2969 
   2970 /**
   2971  * RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING
   2972  *
   2973  * Indicates that the StkSerivce is running and is
   2974  * ready to receive RIL_UNSOL_STK_XXXXX commands.
   2975  *
   2976  * "data" is NULL
   2977  * "response" is NULL
   2978  *
   2979  * Valid errors:
   2980  *  SUCCESS
   2981  *  RADIO_NOT_AVAILABLE
   2982  *  GENERIC_FAILURE
   2983  *
   2984  */
   2985 #define RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING 103
   2986 
   2987 /***********************************************************************/
   2988 
   2989 
   2990 #define RIL_UNSOL_RESPONSE_BASE 1000
   2991 
   2992 /**
   2993  * RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED
   2994  *
   2995  * Indicate when value of RIL_RadioState has changed.
   2996  *
   2997  * Callee will invoke RIL_RadioStateRequest method on main thread
   2998  *
   2999  * "data" is NULL
   3000  */
   3001 
   3002 #define RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED 1000
   3003 
   3004 
   3005 /**
   3006  * RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED
   3007  *
   3008  * Indicate when call state has changed
   3009  *
   3010  * Callee will invoke RIL_REQUEST_GET_CURRENT_CALLS on main thread
   3011  *
   3012  * "data" is NULL
   3013  *
   3014  * Response should be invoked on, for example,
   3015  * "RING", "BUSY", "NO CARRIER", and also call state
   3016  * transitions (DIALING->ALERTING ALERTING->ACTIVE)
   3017  *
   3018  * Redundent or extraneous invocations are tolerated
   3019  */
   3020 #define RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED 1001
   3021 
   3022 
   3023 /**
   3024  * RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED
   3025  *
   3026  * Called when network state, operator name, or GPRS state has changed
   3027  * Basically on, +CREG and +CGREG
   3028  *
   3029  * Callee will invoke the following requests on main thread:
   3030  *
   3031  * RIL_REQUEST_REGISTRATION_STATE
   3032  * RIL_REQUEST_GPRS_REGISTRATION_STATE
   3033  * RIL_REQUEST_OPERATOR
   3034  *
   3035  * "data" is NULL
   3036  *
   3037  * FIXME should this happen when SIM records are loaded? (eg, for
   3038  * EONS)
   3039  */
   3040 #define RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED 1002
   3041 
   3042 /**
   3043  * RIL_UNSOL_RESPONSE_NEW_SMS
   3044  *
   3045  * Called when new SMS is received.
   3046  *
   3047  * "data" is const char *
   3048  * This is a pointer to a string containing the PDU of an SMS-DELIVER
   3049  * as an ascii string of hex digits. The PDU starts with the SMSC address
   3050  * per TS 27.005 (+CMT:)
   3051  *
   3052  * Callee will subsequently confirm the receipt of thei SMS with a
   3053  * RIL_REQUEST_SMS_ACKNOWLEDGE
   3054  *
   3055  * No new RIL_UNSOL_RESPONSE_NEW_SMS
   3056  * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
   3057  * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
   3058  */
   3059 
   3060 #define RIL_UNSOL_RESPONSE_NEW_SMS 1003
   3061 
   3062 /**
   3063  * RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT
   3064  *
   3065  * Called when new SMS Status Report is received.
   3066  *
   3067  * "data" is const char *
   3068  * This is a pointer to a string containing the PDU of an SMS-STATUS-REPORT
   3069  * as an ascii string of hex digits. The PDU starts with the SMSC address
   3070  * per TS 27.005 (+CDS:).
   3071  *
   3072  * Callee will subsequently confirm the receipt of the SMS with a
   3073  * RIL_REQUEST_SMS_ACKNOWLEDGE
   3074  *
   3075  * No new RIL_UNSOL_RESPONSE_NEW_SMS
   3076  * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
   3077  * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
   3078  */
   3079 
   3080 #define RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT 1004
   3081 
   3082 /**
   3083  * RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM
   3084  *
   3085  * Called when new SMS has been stored on SIM card
   3086  *
   3087  * "data" is const int *
   3088  * ((const int *)data)[0] contains the slot index on the SIM that contains
   3089  * the new message
   3090  */
   3091 
   3092 #define RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM 1005
   3093 
   3094 /**
   3095  * RIL_UNSOL_ON_USSD
   3096  *
   3097  * Called when a new USSD message is received.
   3098  *
   3099  * "data" is const char **
   3100  * ((const char **)data)[0] points to a type code, which is
   3101  *  one of these string values:
   3102  *      "0"   USSD-Notify -- text in ((const char **)data)[1]
   3103  *      "1"   USSD-Request -- text in ((const char **)data)[1]
   3104  *      "2"   Session terminated by network
   3105  *      "3"   other local client (eg, SIM Toolkit) has responded
   3106  *      "4"   Operation not supported
   3107  *      "5"   Network timeout
   3108  *
   3109  * The USSD session is assumed to persist if the type code is "1", otherwise
   3110  * the current session (if any) is assumed to have terminated.
   3111  *
   3112  * ((const char **)data)[1] points to a message string if applicable, which
   3113  * should always be in UTF-8.
   3114  */
   3115 #define RIL_UNSOL_ON_USSD 1006
   3116 /* Previously #define RIL_UNSOL_ON_USSD_NOTIFY 1006   */
   3117 
   3118 /**
   3119  * RIL_UNSOL_ON_USSD_REQUEST
   3120  *
   3121  * Obsolete. Send via RIL_UNSOL_ON_USSD
   3122  */
   3123 #define RIL_UNSOL_ON_USSD_REQUEST 1007
   3124 
   3125 
   3126 /**
   3127  * RIL_UNSOL_NITZ_TIME_RECEIVED
   3128  *
   3129  * Called when radio has received a NITZ time message
   3130  *
   3131  * "data" is const char * pointing to NITZ time string
   3132  * in the form "yy/mm/dd,hh:mm:ss(+/-)tz,dt"
   3133  */
   3134 #define RIL_UNSOL_NITZ_TIME_RECEIVED  1008
   3135 
   3136 /**
   3137  * RIL_UNSOL_SIGNAL_STRENGTH
   3138  *
   3139  * Radio may report signal strength rather han have it polled.
   3140  *
   3141  * "data" is a const RIL_SignalStrength *
   3142  */
   3143 #define RIL_UNSOL_SIGNAL_STRENGTH  1009
   3144 
   3145 
   3146 /**
   3147  * RIL_UNSOL_DATA_CALL_LIST_CHANGED
   3148  *
   3149  * Indicate a PDP context state has changed, or a new context
   3150  * has been activated or deactivated
   3151  * replaces RIL_UNSOL_PDP_CONTEXT_LIST_CHANGED
   3152  *
   3153  * "data" is an array of RIL_Data_Call_Response identical to that
   3154  * returned by RIL_REQUEST_DATA_CALL_LIST
   3155  *
   3156  * See also: RIL_REQUEST_DATA_CALL_LIST
   3157  */
   3158 
   3159 #define RIL_UNSOL_DATA_CALL_LIST_CHANGED 1010
   3160 
   3161 /**
   3162  * RIL_UNSOL_SUPP_SVC_NOTIFICATION
   3163  *
   3164  * Reports supplementary service related notification from the network.
   3165  *
   3166  * "data" is a const RIL_SuppSvcNotification *
   3167  *
   3168  */
   3169 
   3170 #define RIL_UNSOL_SUPP_SVC_NOTIFICATION 1011
   3171 
   3172 /**
   3173  * RIL_UNSOL_STK_SESSION_END
   3174  *
   3175  * Indicate when STK session is terminated by SIM.
   3176  *
   3177  * "data" is NULL
   3178  */
   3179 #define RIL_UNSOL_STK_SESSION_END 1012
   3180 
   3181 /**
   3182  * RIL_UNSOL_STK_PROACTIVE_COMMAND
   3183  *
   3184  * Indicate when SIM issue a STK proactive command to applications
   3185  *
   3186  * "data" is a const char * containing SAT/USAT proactive command
   3187  * in hexadecimal format string starting with command tag
   3188  *
   3189  */
   3190 #define RIL_UNSOL_STK_PROACTIVE_COMMAND 1013
   3191 
   3192 /**
   3193  * RIL_UNSOL_STK_EVENT_NOTIFY
   3194  *
   3195  * Indicate when SIM notifies applcations some event happens.
   3196  * Generally, application does not need to have any feedback to
   3197  * SIM but shall be able to indicate appropriate messages to users.
   3198  *
   3199  * "data" is a const char * containing SAT/USAT commands or responses
   3200  * sent by ME to SIM or commands handled by ME, in hexadecimal format string
   3201  * starting with first byte of response data or command tag
   3202  *
   3203  */
   3204 #define RIL_UNSOL_STK_EVENT_NOTIFY 1014
   3205 
   3206 /**
   3207  * RIL_UNSOL_STK_CALL_SETUP
   3208  *
   3209  * Indicate when SIM wants application to setup a voice call.
   3210  *
   3211  * "data" is const int *
   3212  * ((const int *)data)[0] contains timeout value (in milliseconds)
   3213  */
   3214 #define RIL_UNSOL_STK_CALL_SETUP 1015
   3215 
   3216 /**
   3217  * RIL_UNSOL_SIM_SMS_STORAGE_FULL
   3218  *
   3219  * Indicates that SMS storage on the SIM is full.  Sent when the network
   3220  * attempts to deliver a new SMS message.  Messages cannot be saved on the
   3221  * SIM until space is freed.  In particular, incoming Class 2 messages
   3222  * cannot be stored.
   3223  *
   3224  * "data" is null
   3225  *
   3226  */
   3227 #define RIL_UNSOL_SIM_SMS_STORAGE_FULL 1016
   3228 
   3229 /**
   3230  * RIL_UNSOL_SIM_REFRESH
   3231  *
   3232  * Indicates that file(s) on the SIM have been updated, or the SIM
   3233  * has been reinitialized.
   3234  *
   3235  * "data" is an int *
   3236  * ((int *)data)[0] is a RIL_SimRefreshResult.
   3237  * ((int *)data)[1] is the EFID of the updated file if the result is
   3238  * SIM_FILE_UPDATE or NULL for any other result.
   3239  *
   3240  * Note: If the radio state changes as a result of the SIM refresh (eg,
   3241  * SIM_READY -> SIM_LOCKED_OR_ABSENT), RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED
   3242  * should be sent.
   3243  */
   3244 #define RIL_UNSOL_SIM_REFRESH 1017
   3245 
   3246 /**
   3247  * RIL_UNSOL_CALL_RING
   3248  *
   3249  * Ring indication for an incoming call (eg, RING or CRING event).
   3250  * There must be at least one RIL_UNSOL_CALL_RING at the beginning
   3251  * of a call and sending multiple is optional. If the system property
   3252  * ro.telephony.call_ring.multiple is false then the upper layers
   3253  * will generate the multiple events internally. Otherwise the vendor
   3254  * ril must generate multiple RIL_UNSOL_CALL_RING if
   3255  * ro.telephony.call_ring.multiple is true or if it is absent.
   3256  *
   3257  * The rate of these events is controlled by ro.telephony.call_ring.delay
   3258  * and has a default value of 3000 (3 seconds) if absent.
   3259  *
   3260  * "data" is null for GSM
   3261  * "data" is const RIL_CDMA_SignalInfoRecord * if CDMA
   3262  */
   3263 #define RIL_UNSOL_CALL_RING 1018
   3264 
   3265 /**
   3266  * RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED
   3267  *
   3268  * Indicates that SIM state changes.
   3269  *
   3270  * Callee will invoke RIL_REQUEST_GET_SIM_STATUS on main thread
   3271 
   3272  * "data" is null
   3273  */
   3274 #define RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED 1019
   3275 
   3276 /**
   3277  * RIL_UNSOL_RESPONSE_CDMA_NEW_SMS
   3278  *
   3279  * Called when new CDMA SMS is received
   3280  *
   3281  * "data" is const RIL_CDMA_SMS_Message *
   3282  *
   3283  * Callee will subsequently confirm the receipt of the SMS with
   3284  * a RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE
   3285  *
   3286  * No new RIL_UNSOL_RESPONSE_CDMA_NEW_SMS should be sent until
   3287  * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE has been received
   3288  *
   3289  */
   3290 #define RIL_UNSOL_RESPONSE_CDMA_NEW_SMS 1020
   3291 
   3292 /**
   3293  * RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS
   3294  *
   3295  * Called when new Broadcast SMS is received
   3296  *
   3297  * "data" is const char * of 88 bytes which indicates each page
   3298  * of a CBS Message sent to the MS by the BTS as coded in 3GPP
   3299  * 23.041 Section 9.4.1.1
   3300  *
   3301  */
   3302 #define RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS 1021
   3303 
   3304 /**
   3305  * RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL
   3306  *
   3307  * Indicates that SMS storage on the RUIM is full.  Messages
   3308  * cannot be saved on the RUIM until space is freed.
   3309  *
   3310  * "data" is null
   3311  *
   3312  */
   3313 #define RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL 1022
   3314 
   3315 /**
   3316  * RIL_UNSOL_RESTRICTED_STATE_CHANGED
   3317  *
   3318  * Indicates a restricted state change (eg, for Domain Specific Access Control).
   3319  *
   3320  * Radio need send this msg after radio off/on cycle no matter it is changed or not.
   3321  *
   3322  * "data" is an int *
   3323  * ((int *)data)[0] contains a bitmask of RIL_RESTRICTED_STATE_* values.
   3324  */
   3325 #define RIL_UNSOL_RESTRICTED_STATE_CHANGED 1023
   3326 
   3327 /**
   3328  * RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE
   3329  *
   3330  * Indicates that the radio system selection module has
   3331  * autonomously entered emergency callback mode.
   3332  *
   3333  * "data" is null
   3334  *
   3335  */
   3336 #define RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE 1024
   3337 
   3338 /**
   3339  * RIL_UNSOL_CDMA_CALL_WAITING
   3340  *
   3341  * Called when CDMA radio receives a call waiting indication.
   3342  *
   3343  * "data" is const RIL_CDMA_CallWaiting *
   3344  *
   3345  */
   3346 #define RIL_UNSOL_CDMA_CALL_WAITING 1025
   3347 
   3348 /**
   3349  * RIL_UNSOL_CDMA_OTA_PROVISION_STATUS
   3350  *
   3351  * Called when CDMA radio receives an update of the progress of an
   3352  * OTASP/OTAPA call.
   3353  *
   3354  * "data" is const int *
   3355  *  For CDMA this is an integer OTASP/OTAPA status listed in
   3356  *  RIL_CDMA_OTA_ProvisionStatus.
   3357  *
   3358  */
   3359 #define RIL_UNSOL_CDMA_OTA_PROVISION_STATUS 1026
   3360 
   3361 /**
   3362  * RIL_UNSOL_CDMA_INFO_REC
   3363  *
   3364  * Called when CDMA radio receives one or more info recs.
   3365  *
   3366  * "data" is const RIL_CDMA_InformationRecords *
   3367  *
   3368  */
   3369 #define RIL_UNSOL_CDMA_INFO_REC 1027
   3370 
   3371 /**
   3372  * RIL_UNSOL_OEM_HOOK_RAW
   3373  *
   3374  * This is for OEM specific use.
   3375  *
   3376  * "data" is a byte[]
   3377  */
   3378 #define RIL_UNSOL_OEM_HOOK_RAW 1028
   3379 
   3380 /**
   3381  * RIL_UNSOL_RINGBACK_TONE
   3382  *
   3383  * Indicates that nework doesn't have in-band information,  need to
   3384  * play out-band tone.
   3385  *
   3386  * "data" is an int *
   3387  * ((int *)data)[0] == 0 for stop play ringback tone.
   3388  * ((int *)data)[0] == 1 for start play ringback tone.
   3389  */
   3390 #define RIL_UNSOL_RINGBACK_TONE 1029
   3391 
   3392 /**
   3393  * RIL_UNSOL_RESEND_INCALL_MUTE
   3394  *
   3395  * Indicates that framework/application need reset the uplink mute state.
   3396  *
   3397  * There may be situations where the mute state becomes out of sync
   3398  * between the application and device in some GSM infrastructures.
   3399  *
   3400  * "data" is null
   3401  */
   3402 #define RIL_UNSOL_RESEND_INCALL_MUTE 1030
   3403 /***********************************************************************/
   3404 
   3405 
   3406 /**
   3407  * RIL_Request Function pointer
   3408  *
   3409  * @param request is one of RIL_REQUEST_*
   3410  * @param data is pointer to data defined for that RIL_REQUEST_*
   3411  *        data is owned by caller, and should not be modified or freed by callee
   3412  * @param t should be used in subsequent call to RIL_onResponse
   3413  * @param datalen the length of data
   3414  *
   3415  */
   3416 typedef void (*RIL_RequestFunc) (int request, void *data,
   3417                                     size_t datalen, RIL_Token t);
   3418 
   3419 /**
   3420  * This function should return the current radio state synchronously
   3421  */
   3422 typedef RIL_RadioState (*RIL_RadioStateRequest)();
   3423 
   3424 /**
   3425  * This function returns "1" if the specified RIL_REQUEST code is
   3426  * supported and 0 if it is not
   3427  *
   3428  * @param requestCode is one of RIL_REQUEST codes
   3429  */
   3430 
   3431 typedef int (*RIL_Supports)(int requestCode);
   3432 
   3433 /**
   3434  * This function is called from a separate thread--not the
   3435  * thread that calls RIL_RequestFunc--and indicates that a pending
   3436  * request should be cancelled.
   3437  *
   3438  * On cancel, the callee should do its best to abandon the request and
   3439  * call RIL_onRequestComplete with RIL_Errno CANCELLED at some later point.
   3440  *
   3441  * Subsequent calls to  RIL_onRequestComplete for this request with
   3442  * other results will be tolerated but ignored. (That is, it is valid
   3443  * to ignore the cancellation request)
   3444  *
   3445  * RIL_Cancel calls should return immediately, and not wait for cancellation
   3446  *
   3447  * Please see ITU v.250 5.6.1 for how one might implement this on a TS 27.007
   3448  * interface
   3449  *
   3450  * @param t token wants to be canceled
   3451  */
   3452 
   3453 typedef void (*RIL_Cancel)(RIL_Token t);
   3454 
   3455 typedef void (*RIL_TimedCallback) (void *param);
   3456 
   3457 /**
   3458  * Return a version string for your RIL implementation
   3459  */
   3460 typedef const char * (*RIL_GetVersion) (void);
   3461 
   3462 typedef struct {
   3463     int version;        /* set to RIL_VERSION */
   3464     RIL_RequestFunc onRequest;
   3465     RIL_RadioStateRequest onStateRequest;
   3466     RIL_Supports supports;
   3467     RIL_Cancel onCancel;
   3468     RIL_GetVersion getVersion;
   3469 } RIL_RadioFunctions;
   3470 
   3471 #ifdef RIL_SHLIB
   3472 struct RIL_Env {
   3473     /**
   3474      * "t" is parameter passed in on previous call to RIL_Notification
   3475      * routine.
   3476      *
   3477      * If "e" != SUCCESS, then response can be null/is ignored
   3478      *
   3479      * "response" is owned by caller, and should not be modified or
   3480      * freed by callee
   3481      *
   3482      * RIL_onRequestComplete will return as soon as possible
   3483      */
   3484     void (*OnRequestComplete)(RIL_Token t, RIL_Errno e,
   3485                            void *response, size_t responselen);
   3486 
   3487     /**
   3488      * "unsolResponse" is one of RIL_UNSOL_RESPONSE_*
   3489      * "data" is pointer to data defined for that RIL_UNSOL_RESPONSE_*
   3490      *
   3491      * "data" is owned by caller, and should not be modified or freed by callee
   3492      */
   3493 
   3494     void (*OnUnsolicitedResponse)(int unsolResponse, const void *data,
   3495                                     size_t datalen);
   3496 
   3497     /**
   3498      * Call user-specifed "callback" function on on the same thread that
   3499      * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
   3500      * a relative time value at which the callback is invoked. If relativeTime is
   3501      * NULL or points to a 0-filled structure, the callback will be invoked as
   3502      * soon as possible
   3503      */
   3504 
   3505     void (*RequestTimedCallback) (RIL_TimedCallback callback,
   3506                                    void *param, const struct timeval *relativeTime);
   3507 };
   3508 
   3509 
   3510 /**
   3511  *  RIL implementations must defined RIL_Init
   3512  *  argc and argv will be command line arguments intended for the RIL implementation
   3513  *  Return NULL on error
   3514  *
   3515  * @param env is environment point defined as RIL_Env
   3516  * @param argc number of arguments
   3517  * @param argv list fo arguments
   3518  *
   3519  */
   3520 const RIL_RadioFunctions *RIL_Init(const struct RIL_Env *env, int argc, char **argv);
   3521 
   3522 #else /* RIL_SHLIB */
   3523 
   3524 /**
   3525  * Call this once at startup to register notification routine
   3526  *
   3527  * @param callbacks user-specifed callback function
   3528  */
   3529 void RIL_register (const RIL_RadioFunctions *callbacks);
   3530 
   3531 
   3532 /**
   3533  *
   3534  * RIL_onRequestComplete will return as soon as possible
   3535  *
   3536  * @param t is parameter passed in on previous call to RIL_Notification
   3537  *          routine.
   3538  * @param e error code
   3539  *          if "e" != SUCCESS, then response can be null/is ignored
   3540  * @param response is owned by caller, and should not be modified or
   3541  *                 freed by callee
   3542  * @param responselen the length of response in byte
   3543  */
   3544 void RIL_onRequestComplete(RIL_Token t, RIL_Errno e,
   3545                            void *response, size_t responselen);
   3546 
   3547 /**
   3548  * @param unsolResponse is one of RIL_UNSOL_RESPONSE_*
   3549  * @param data is pointer to data defined for that RIL_UNSOL_RESPONSE_*
   3550  *     "data" is owned by caller, and should not be modified or freed by callee
   3551  * @param datalen the length of data in byte
   3552  */
   3553 
   3554 void RIL_onUnsolicitedResponse(int unsolResponse, const void *data,
   3555                                 size_t datalen);
   3556 
   3557 
   3558 /**
   3559  * Call user-specifed "callback" function on on the same thread that
   3560  * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
   3561  * a relative time value at which the callback is invoked. If relativeTime is
   3562  * NULL or points to a 0-filled structure, the callback will be invoked as
   3563  * soon as possible
   3564  *
   3565  * @param callback user-specifed callback function
   3566  * @param param parameter list
   3567  * @param relativeTime a relative time value at which the callback is invoked
   3568  */
   3569 
   3570 void RIL_requestTimedCallback (RIL_TimedCallback callback,
   3571                                void *param, const struct timeval *relativeTime);
   3572 
   3573 
   3574 #endif /* RIL_SHLIB */
   3575 
   3576 #ifdef __cplusplus
   3577 }
   3578 #endif
   3579 
   3580 #endif /*ANDROID_RIL_H*/
   3581