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