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