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