OSDN Git Service

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