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