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