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