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