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