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