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