OSDN Git Service

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