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