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