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