OSDN Git Service

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