OSDN Git Service

a5079f4cd818f1f78bba9fda8ec38c1e483547b9
[android-x86/hardware-ril.git] / include / telephony / ril.h
1 /*
2  * Copyright (C) 2006 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef ANDROID_RIL_H
18 #define ANDROID_RIL_H 1
19
20 #include <stdlib.h>
21 #include <stdint.h>
22 #include <telephony/ril_cdma_sms.h>
23 #include <telephony/ril_nv_items.h>
24 #include <telephony/ril_msim.h>
25
26 #ifndef FEATURE_UNIT_TEST
27 #include <sys/time.h>
28 #endif /* !FEATURE_UNIT_TEST */
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34
35 #if defined(ANDROID_SIM_COUNT_2)
36 #define SIM_COUNT 2
37 #elif defined(ANDROID_SIM_COUNT_3)
38 #define SIM_COUNT 3
39 #elif defined(ANDROID_SIM_COUNT_4)
40 #define SIM_COUNT 4
41 #else
42 #define SIM_COUNT 1
43 #endif
44
45 #ifndef ANDROID_MULTI_SIM
46 #define SIM_COUNT 1
47 #endif
48
49 #define RIL_VERSION 11     /* Current version */
50 #define RIL_VERSION_MIN 6 /* Minimum RIL_VERSION supported */
51
52 #define CDMA_ALPHA_INFO_BUFFER_LENGTH 64
53 #define CDMA_NUMBER_INFO_BUFFER_LENGTH 81
54
55 #define MAX_RILDS 3
56 #define MAX_SOCKET_NAME_LENGTH 6
57 #define MAX_CLIENT_ID_LENGTH 2
58 #define MAX_DEBUG_SOCKET_NAME_LENGTH 12
59 #define MAX_QEMU_PIPE_NAME_LENGTH  11
60 #define MAX_UUID_LENGTH 64
61
62
63 typedef void * RIL_Token;
64
65 typedef enum {
66     RIL_SOCKET_1,
67 #if (SIM_COUNT >= 2)
68     RIL_SOCKET_2,
69 #if (SIM_COUNT >= 3)
70     RIL_SOCKET_3,
71 #endif
72 #if (SIM_COUNT >= 4)
73     RIL_SOCKET_4,
74 #endif
75 #endif
76     RIL_SOCKET_NUM
77 } RIL_SOCKET_ID;
78
79
80 typedef enum {
81     RIL_E_SUCCESS = 0,
82     RIL_E_RADIO_NOT_AVAILABLE = 1,     /* If radio did not start or is resetting */
83     RIL_E_GENERIC_FAILURE = 2,
84     RIL_E_PASSWORD_INCORRECT = 3,      /* for PIN/PIN2 methods only! */
85     RIL_E_SIM_PIN2 = 4,                /* Operation requires SIM PIN2 to be entered */
86     RIL_E_SIM_PUK2 = 5,                /* Operation requires SIM PIN2 to be entered */
87     RIL_E_REQUEST_NOT_SUPPORTED = 6,
88     RIL_E_CANCELLED = 7,
89     RIL_E_OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, /* data ops are not allowed during voice
90                                                    call on a Class C GPRS device */
91     RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9,  /* data ops are not allowed before device
92                                                    registers in network */
93     RIL_E_SMS_SEND_FAIL_RETRY = 10,             /* fail to send sms and need retry */
94     RIL_E_SIM_ABSENT = 11,                      /* fail to set the location where CDMA subscription
95                                                    shall be retrieved because of SIM or RUIM
96                                                    card absent */
97     RIL_E_SUBSCRIPTION_NOT_AVAILABLE = 12,      /* fail to find CDMA subscription from specified
98                                                    location */
99     RIL_E_MODE_NOT_SUPPORTED = 13,              /* HW does not support preferred network type */
100     RIL_E_FDN_CHECK_FAILURE = 14,               /* command failed because recipient is not on FDN list */
101     RIL_E_ILLEGAL_SIM_OR_ME = 15,               /* network selection failed due to
102                                                    illegal SIM or ME */
103     RIL_E_MISSING_RESOURCE = 16,                /* no logical channel available */
104     RIL_E_NO_SUCH_ELEMENT = 17,                  /* application not found on SIM */
105     RIL_E_DIAL_MODIFIED_TO_USSD = 18,           /* DIAL request modified to USSD */
106     RIL_E_DIAL_MODIFIED_TO_SS = 19,             /* DIAL request modified to SS */
107     RIL_E_DIAL_MODIFIED_TO_DIAL = 20,           /* DIAL request modified to DIAL with different
108                                                    data */
109     RIL_E_USSD_MODIFIED_TO_DIAL = 21,           /* USSD request modified to DIAL */
110     RIL_E_USSD_MODIFIED_TO_SS = 22,             /* USSD request modified to SS */
111     RIL_E_USSD_MODIFIED_TO_USSD = 23,           /* USSD request modified to different USSD
112                                                    request */
113     RIL_E_SS_MODIFIED_TO_DIAL = 24,             /* SS request modified to DIAL */
114     RIL_E_SS_MODIFIED_TO_USSD = 25,             /* SS request modified to USSD */
115     RIL_E_SUBSCRIPTION_NOT_SUPPORTED = 26,      /* Subscription not supported by RIL */
116     RIL_E_SS_MODIFIED_TO_SS = 27                /* SS request modified to different SS request */
117
118
119 } RIL_Errno;
120
121 typedef enum {
122     RIL_CALL_ACTIVE = 0,
123     RIL_CALL_HOLDING = 1,
124     RIL_CALL_DIALING = 2,    /* MO call only */
125     RIL_CALL_ALERTING = 3,   /* MO call only */
126     RIL_CALL_INCOMING = 4,   /* MT call only */
127     RIL_CALL_WAITING = 5     /* MT call only */
128 } RIL_CallState;
129
130 typedef enum {
131     RADIO_STATE_OFF = 0,                   /* Radio explictly powered off (eg CFUN=0) */
132     RADIO_STATE_UNAVAILABLE = 1,           /* Radio unavailable (eg, resetting or not booted) */
133     /* States 2-9 below are deprecated. Just leaving them here for backward compatibility. */
134     RADIO_STATE_SIM_NOT_READY = 2,         /* Radio is on, but the SIM interface is not ready */
135     RADIO_STATE_SIM_LOCKED_OR_ABSENT = 3,  /* SIM PIN locked, PUK required, network
136                                               personalization locked, or SIM absent */
137     RADIO_STATE_SIM_READY = 4,             /* Radio is on and SIM interface is available */
138     RADIO_STATE_RUIM_NOT_READY = 5,        /* Radio is on, but the RUIM interface is not ready */
139     RADIO_STATE_RUIM_READY = 6,            /* Radio is on and the RUIM interface is available */
140     RADIO_STATE_RUIM_LOCKED_OR_ABSENT = 7, /* RUIM PIN locked, PUK required, network
141                                               personalization locked, or RUIM absent */
142     RADIO_STATE_NV_NOT_READY = 8,          /* Radio is on, but the NV interface is not available */
143     RADIO_STATE_NV_READY = 9,              /* Radio is on and the NV interface is available */
144     RADIO_STATE_ON = 10                    /* Radio is on */
145 } RIL_RadioState;
146
147 typedef enum {
148     RADIO_TECH_UNKNOWN = 0,
149     RADIO_TECH_GPRS = 1,
150     RADIO_TECH_EDGE = 2,
151     RADIO_TECH_UMTS = 3,
152     RADIO_TECH_IS95A = 4,
153     RADIO_TECH_IS95B = 5,
154     RADIO_TECH_1xRTT =  6,
155     RADIO_TECH_EVDO_0 = 7,
156     RADIO_TECH_EVDO_A = 8,
157     RADIO_TECH_HSDPA = 9,
158     RADIO_TECH_HSUPA = 10,
159     RADIO_TECH_HSPA = 11,
160     RADIO_TECH_EVDO_B = 12,
161     RADIO_TECH_EHRPD = 13,
162     RADIO_TECH_LTE = 14,
163     RADIO_TECH_HSPAP = 15, // HSPA+
164     RADIO_TECH_GSM = 16, // Only supports voice
165     RADIO_TECH_TD_SCDMA = 17,
166     RADIO_TECH_IWLAN = 18
167 } RIL_RadioTechnology;
168
169 typedef enum {
170     RAF_UNKNOWN =  (1 <<  RADIO_TECH_UNKNOWN),
171     RAF_GPRS = (1 << RADIO_TECH_GPRS),
172     RAF_EDGE = (1 << RADIO_TECH_EDGE),
173     RAF_UMTS = (1 << RADIO_TECH_UMTS),
174     RAF_IS95A = (1 << RADIO_TECH_IS95A),
175     RAF_IS95B = (1 << RADIO_TECH_IS95B),
176     RAF_1xRTT = (1 << RADIO_TECH_1xRTT),
177     RAF_EVDO_0 = (1 << RADIO_TECH_EVDO_0),
178     RAF_EVDO_A = (1 << RADIO_TECH_EVDO_A),
179     RAF_HSDPA = (1 << RADIO_TECH_HSDPA),
180     RAF_HSUPA = (1 << RADIO_TECH_HSUPA),
181     RAF_HSPA = (1 << RADIO_TECH_HSPA),
182     RAF_EVDO_B = (1 << RADIO_TECH_EVDO_B),
183     RAF_EHRPD = (1 << RADIO_TECH_EHRPD),
184     RAF_LTE = (1 << RADIO_TECH_LTE),
185     RAF_HSPAP = (1 << RADIO_TECH_HSPAP),
186     RAF_GSM = (1 << RADIO_TECH_GSM),
187     RAF_TD_SCDMA = (1 << RADIO_TECH_TD_SCDMA),
188 } RIL_RadioAccessFamily;
189
190 typedef enum {
191     RC_PHASE_CONFIGURED = 0,  // LM is configured is initial value and value after FINISH completes
192     RC_PHASE_START      = 1,  // START is sent before Apply and indicates that an APPLY will be
193                               // forthcoming with these same parameters
194     RC_PHASE_APPLY      = 2,  // APPLY is sent after all LM's receive START and returned
195                               // RIL_RadioCapability.status = 0, if any START's fail no
196                               // APPLY will be sent
197     RC_PHASE_UNSOL_RSP  = 3,  // UNSOL_RSP is sent with RIL_UNSOL_RADIO_CAPABILITY
198     RC_PHASE_FINISH     = 4   // FINISH is sent after all commands have completed. If an error
199                               // occurs in any previous command the RIL_RadioAccessesFamily and
200                               // logicalModemUuid fields will be the prior configuration thus
201                               // restoring the configuration to the previous value. An error
202                               // returned by this command will generally be ignored or may
203                               // cause that logical modem to be removed from service.
204 } RadioCapabilityPhase;
205
206 typedef enum {
207     RC_STATUS_NONE       = 0, // This parameter has no meaning with RC_PHASE_START,
208                               // RC_PHASE_APPLY
209     RC_STATUS_SUCCESS    = 1, // Tell modem the action transaction of set radio
210                               // capability was success with RC_PHASE_FINISH
211     RC_STATUS_FAIL       = 2, // Tell modem the action transaction of set radio
212                               // capability is fail with RC_PHASE_FINISH.
213 } RadioCapabilityStatus;
214
215 #define RIL_RADIO_CAPABILITY_VERSION 1
216 typedef struct {
217     int version;            // Version of structure, RIL_RADIO_CAPABILITY_VERSION
218     int session;            // Unique session value defined by framework returned in all "responses/unsol"
219     int phase;              // CONFIGURED, START, APPLY, FINISH
220     int rat;                // RIL_RadioAccessFamily for the radio
221     char logicalModemUuid[MAX_UUID_LENGTH]; // A UUID typically "com.xxxx.lmX where X is the logical modem.
222     int status;             // Return status and an input parameter for RC_PHASE_FINISH
223 } RIL_RadioCapability;
224
225 // Do we want to split Data from Voice and the use
226 // RIL_RadioTechnology for get/setPreferredVoice/Data ?
227 typedef enum {
228     PREF_NET_TYPE_GSM_WCDMA                = 0, /* GSM/WCDMA (WCDMA preferred) */
229     PREF_NET_TYPE_GSM_ONLY                 = 1, /* GSM only */
230     PREF_NET_TYPE_WCDMA                    = 2, /* WCDMA  */
231     PREF_NET_TYPE_GSM_WCDMA_AUTO           = 3, /* GSM/WCDMA (auto mode, according to PRL) */
232     PREF_NET_TYPE_CDMA_EVDO_AUTO           = 4, /* CDMA and EvDo (auto mode, according to PRL) */
233     PREF_NET_TYPE_CDMA_ONLY                = 5, /* CDMA only */
234     PREF_NET_TYPE_EVDO_ONLY                = 6, /* EvDo only */
235     PREF_NET_TYPE_GSM_WCDMA_CDMA_EVDO_AUTO = 7, /* GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL) */
236     PREF_NET_TYPE_LTE_CDMA_EVDO            = 8, /* LTE, CDMA and EvDo */
237     PREF_NET_TYPE_LTE_GSM_WCDMA            = 9, /* LTE, GSM/WCDMA */
238     PREF_NET_TYPE_LTE_CMDA_EVDO_GSM_WCDMA  = 10, /* LTE, CDMA, EvDo, GSM/WCDMA */
239     PREF_NET_TYPE_LTE_ONLY                 = 11, /* LTE only */
240     PREF_NET_TYPE_LTE_WCDMA                = 12  /* LTE/WCDMA */
241 } RIL_PreferredNetworkType;
242
243 /* Source for cdma subscription */
244 typedef enum {
245    CDMA_SUBSCRIPTION_SOURCE_RUIM_SIM = 0,
246    CDMA_SUBSCRIPTION_SOURCE_NV = 1
247 } RIL_CdmaSubscriptionSource;
248
249 /* User-to-User signaling Info activation types derived from 3GPP 23.087 v8.0 */
250 typedef enum {
251     RIL_UUS_TYPE1_IMPLICIT = 0,
252     RIL_UUS_TYPE1_REQUIRED = 1,
253     RIL_UUS_TYPE1_NOT_REQUIRED = 2,
254     RIL_UUS_TYPE2_REQUIRED = 3,
255     RIL_UUS_TYPE2_NOT_REQUIRED = 4,
256     RIL_UUS_TYPE3_REQUIRED = 5,
257     RIL_UUS_TYPE3_NOT_REQUIRED = 6
258 } RIL_UUS_Type;
259
260 /* User-to-User Signaling Information data coding schemes. Possible values for
261  * Octet 3 (Protocol Discriminator field) in the UUIE. The values have been
262  * specified in section 10.5.4.25 of 3GPP TS 24.008 */
263 typedef enum {
264     RIL_UUS_DCS_USP = 0,          /* User specified protocol */
265     RIL_UUS_DCS_OSIHLP = 1,       /* OSI higher layer protocol */
266     RIL_UUS_DCS_X244 = 2,         /* X.244 */
267     RIL_UUS_DCS_RMCF = 3,         /* Reserved for system mangement
268                                      convergence function */
269     RIL_UUS_DCS_IA5c = 4          /* IA5 characters */
270 } RIL_UUS_DCS;
271
272 /* User-to-User Signaling Information defined in 3GPP 23.087 v8.0
273  * This data is passed in RIL_ExtensionRecord and rec contains this
274  * structure when type is RIL_UUS_INFO_EXT_REC */
275 typedef struct {
276   RIL_UUS_Type    uusType;    /* UUS Type */
277   RIL_UUS_DCS     uusDcs;     /* UUS Data Coding Scheme */
278   int             uusLength;  /* Length of UUS Data */
279   char *          uusData;    /* UUS Data */
280 } RIL_UUS_Info;
281
282 /* CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */
283 typedef struct {
284   char isPresent;    /* non-zero if signal information record is present */
285   char signalType;   /* as defined 3.7.5.5-1 */
286   char alertPitch;   /* as defined 3.7.5.5-2 */
287   char signal;       /* as defined 3.7.5.5-3, 3.7.5.5-4 or 3.7.5.5-5 */
288 } RIL_CDMA_SignalInfoRecord;
289
290 typedef struct {
291     RIL_CallState   state;
292     int             index;      /* Connection Index for use with, eg, AT+CHLD */
293     int             toa;        /* type of address, eg 145 = intl */
294     char            isMpty;     /* nonzero if is mpty call */
295     char            isMT;       /* nonzero if call is mobile terminated */
296     char            als;        /* ALS line indicator if available
297                                    (0 = line 1) */
298     char            isVoice;    /* nonzero if this is is a voice call */
299     char            isVoicePrivacy;     /* nonzero if CDMA voice privacy mode is active */
300     char *          number;     /* Remote party number */
301     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
302     char *          name;       /* Remote party name */
303     int             namePresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */
304     RIL_UUS_Info *  uusInfo;    /* NULL or Pointer to User-User Signaling Information */
305 } RIL_Call;
306
307 /* Deprecated, use RIL_Data_Call_Response_v6 */
308 typedef struct {
309     int             cid;        /* Context ID, uniquely identifies this call */
310     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
311     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
312                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". */
313     char *          apn;        /* ignored */
314     char *          address;    /* An address, e.g., "192.0.1.3" or "2001:db8::1". */
315 } RIL_Data_Call_Response_v4;
316
317 /*
318  * Returned by RIL_REQUEST_SETUP_DATA_CALL, RIL_REQUEST_DATA_CALL_LIST
319  * and RIL_UNSOL_DATA_CALL_LIST_CHANGED, on error status != 0.
320  */
321 typedef struct {
322     int             status;     /* A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error */
323     int             suggestedRetryTime; /* If status != 0, this fields indicates the suggested retry
324                                            back-off timer value RIL wants to override the one
325                                            pre-configured in FW.
326                                            The unit is miliseconds.
327                                            The value < 0 means no value is suggested.
328                                            The value 0 means retry should be done ASAP.
329                                            The value of INT_MAX(0x7fffffff) means no retry. */
330     int             cid;        /* Context ID, uniquely identifies this call */
331     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
332     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
333                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". If status is
334                                    PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED this is the type supported
335                                    such as "IP" or "IPV6" */
336     char *          ifname;     /* The network interface name */
337     char *          addresses;  /* A space-delimited list of addresses with optional "/" prefix length,
338                                    e.g., "192.0.1.3" or "192.0.1.11/16 2001:db8::1/64".
339                                    May not be empty, typically 1 IPv4 or 1 IPv6 or
340                                    one of each. If the prefix length is absent the addresses
341                                    are assumed to be point to point with IPv4 having a prefix
342                                    length of 32 and IPv6 128. */
343     char *          dnses;      /* A space-delimited list of DNS server addresses,
344                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
345                                    May be empty. */
346     char *          gateways;   /* A space-delimited list of default gateway addresses,
347                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
348                                    May be empty in which case the addresses represent point
349                                    to point connections. */
350 } RIL_Data_Call_Response_v6;
351
352 typedef struct {
353     int             status;     /* A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error */
354     int             suggestedRetryTime; /* If status != 0, this fields indicates the suggested retry
355                                            back-off timer value RIL wants to override the one
356                                            pre-configured in FW.
357                                            The unit is miliseconds.
358                                            The value < 0 means no value is suggested.
359                                            The value 0 means retry should be done ASAP.
360                                            The value of INT_MAX(0x7fffffff) means no retry. */
361     int             cid;        /* Context ID, uniquely identifies this call */
362     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
363     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
364                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". If status is
365                                    PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED this is the type supported
366                                    such as "IP" or "IPV6" */
367     char *          ifname;     /* The network interface name */
368     char *          addresses;  /* A space-delimited list of addresses with optional "/" prefix length,
369                                    e.g., "192.0.1.3" or "192.0.1.11/16 2001:db8::1/64".
370                                    May not be empty, typically 1 IPv4 or 1 IPv6 or
371                                    one of each. If the prefix length is absent the addresses
372                                    are assumed to be point to point with IPv4 having a prefix
373                                    length of 32 and IPv6 128. */
374     char *          dnses;      /* A space-delimited list of DNS server addresses,
375                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
376                                    May be empty. */
377     char *          gateways;   /* A space-delimited list of default gateway addresses,
378                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
379                                    May be empty in which case the addresses represent point
380                                    to point connections. */
381     char *          pcscf;    /* the Proxy Call State Control Function address
382                                  via PCO(Protocol Configuration Option) for IMS client. */
383 } RIL_Data_Call_Response_v9;
384
385 typedef struct {
386     int             status;     /* A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error */
387     int             suggestedRetryTime; /* If status != 0, this fields indicates the suggested retry
388                                            back-off timer value RIL wants to override the one
389                                            pre-configured in FW.
390                                            The unit is miliseconds.
391                                            The value < 0 means no value is suggested.
392                                            The value 0 means retry should be done ASAP.
393                                            The value of INT_MAX(0x7fffffff) means no retry. */
394     int             cid;        /* Context ID, uniquely identifies this call */
395     int             active;     /* 0=inactive, 1=active/physical link down, 2=active/physical link up */
396     char *          type;       /* One of the PDP_type values in TS 27.007 section 10.1.1.
397                                    For example, "IP", "IPV6", "IPV4V6", or "PPP". If status is
398                                    PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED this is the type supported
399                                    such as "IP" or "IPV6" */
400     char *          ifname;     /* The network interface name */
401     char *          addresses;  /* A space-delimited list of addresses with optional "/" prefix length,
402                                    e.g., "192.0.1.3" or "192.0.1.11/16 2001:db8::1/64".
403                                    May not be empty, typically 1 IPv4 or 1 IPv6 or
404                                    one of each. If the prefix length is absent the addresses
405                                    are assumed to be point to point with IPv4 having a prefix
406                                    length of 32 and IPv6 128. */
407     char *          dnses;      /* A space-delimited list of DNS server addresses,
408                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
409                                    May be empty. */
410     char *          gateways;   /* A space-delimited list of default gateway addresses,
411                                    e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
412                                    May be empty in which case the addresses represent point
413                                    to point connections. */
414     char *          pcscf;    /* the Proxy Call State Control Function address
415                                  via PCO(Protocol Configuration Option) for IMS client. */
416     int             mtu;        /* MTU received from network
417                                    Value <= 0 means network has either not sent a value or
418                                    sent an invalid value */
419 } RIL_Data_Call_Response_v11;
420
421 typedef enum {
422     RADIO_TECH_3GPP = 1, /* 3GPP Technologies - GSM, WCDMA */
423     RADIO_TECH_3GPP2 = 2 /* 3GPP2 Technologies - CDMA */
424 } RIL_RadioTechnologyFamily;
425
426 typedef struct {
427     RIL_RadioTechnologyFamily tech;
428     unsigned char             retry;       /* 0 == not retry, nonzero == retry */
429     int                       messageRef;  /* Valid field if retry is set to nonzero.
430                                               Contains messageRef from RIL_SMS_Response
431                                               corresponding to failed MO SMS.
432                                             */
433
434     union {
435         /* Valid field if tech is RADIO_TECH_3GPP2. See RIL_REQUEST_CDMA_SEND_SMS */
436         RIL_CDMA_SMS_Message* cdmaMessage;
437
438         /* Valid field if tech is RADIO_TECH_3GPP. See RIL_REQUEST_SEND_SMS */
439         char**                gsmMessage;
440     } message;
441 } RIL_IMS_SMS_Message;
442
443 typedef struct {
444     int messageRef;   /* TP-Message-Reference for GSM,
445                          and BearerData MessageId for CDMA
446                          (See 3GPP2 C.S0015-B, v2.0, table 4.5-1). */
447     char *ackPDU;     /* or NULL if n/a */
448     int errorCode;    /* See 3GPP 27.005, 3.2.5 for GSM/UMTS,
449                          3GPP2 N.S0005 (IS-41C) Table 171 for CDMA,
450                          -1 if unknown or not applicable*/
451 } RIL_SMS_Response;
452
453 /** Used by RIL_REQUEST_WRITE_SMS_TO_SIM */
454 typedef struct {
455     int status;     /* Status of message.  See TS 27.005 3.1, "<stat>": */
456                     /*      0 = "REC UNREAD"    */
457                     /*      1 = "REC READ"      */
458                     /*      2 = "STO UNSENT"    */
459                     /*      3 = "STO SENT"      */
460     char * pdu;     /* PDU of message to write, as an ASCII hex string less the SMSC address,
461                        the TP-layer length is "strlen(pdu)/2". */
462     char * smsc;    /* SMSC address in GSM BCD format prefixed by a length byte
463                        (as expected by TS 27.005) or NULL for default SMSC */
464 } RIL_SMS_WriteArgs;
465
466 /** Used by RIL_REQUEST_DIAL */
467 typedef struct {
468     char * address;
469     int clir;
470             /* (same as 'n' paremeter in TS 27.007 7.7 "+CLIR"
471              * clir == 0 on "use subscription default value"
472              * clir == 1 on "CLIR invocation" (restrict CLI presentation)
473              * clir == 2 on "CLIR suppression" (allow CLI presentation)
474              */
475     RIL_UUS_Info *  uusInfo;    /* NULL or Pointer to User-User Signaling Information */
476 } RIL_Dial;
477
478 typedef struct {
479     int command;    /* one of the commands listed for TS 27.007 +CRSM*/
480     int fileid;     /* EF id */
481     char *path;     /* "pathid" from TS 27.007 +CRSM command.
482                        Path is in hex asciii format eg "7f205f70"
483                        Path must always be provided.
484                      */
485     int p1;
486     int p2;
487     int p3;
488     char *data;     /* May be NULL*/
489     char *pin2;     /* May be NULL*/
490 } RIL_SIM_IO_v5;
491
492 typedef struct {
493     int command;    /* one of the commands listed for TS 27.007 +CRSM*/
494     int fileid;     /* EF id */
495     char *path;     /* "pathid" from TS 27.007 +CRSM command.
496                        Path is in hex asciii format eg "7f205f70"
497                        Path must always be provided.
498                      */
499     int p1;
500     int p2;
501     int p3;
502     char *data;     /* May be NULL*/
503     char *pin2;     /* May be NULL*/
504     char *aidPtr;   /* AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. */
505 } RIL_SIM_IO_v6;
506
507 /* Used by RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL and
508  * RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC. */
509 typedef struct {
510     int sessionid;  /* "sessionid" from TS 27.007 +CGLA command. Should be
511                        ignored for +CSIM command. */
512
513     /* Following fields are used to derive the APDU ("command" and "length"
514        values in TS 27.007 +CSIM and +CGLA commands). */
515     int cla;
516     int instruction;
517     int p1;
518     int p2;
519     int p3;         /* A negative P3 implies a 4 byte APDU. */
520     char *data;     /* May be NULL. In hex string format. */
521 } RIL_SIM_APDU;
522
523 typedef struct {
524     int sw1;
525     int sw2;
526     char *simResponse;  /* In hex string format ([a-fA-F0-9]*), except for SIM_AUTHENTICATION
527                            response for which it is in Base64 format, see 3GPP TS 31.102 7.1.2 */
528 } RIL_SIM_IO_Response;
529
530 /* See also com.android.internal.telephony.gsm.CallForwardInfo */
531
532 typedef struct {
533     int             status;     /*
534                                  * For RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
535                                  * status 1 = active, 0 = not active
536                                  *
537                                  * For RIL_REQUEST_SET_CALL_FORWARD:
538                                  * status is:
539                                  * 0 = disable
540                                  * 1 = enable
541                                  * 2 = interrogate
542                                  * 3 = registeration
543                                  * 4 = erasure
544                                  */
545
546     int             reason;      /* from TS 27.007 7.11 "reason" */
547     int             serviceClass;/* From 27.007 +CCFC/+CLCK "class"
548                                     See table for Android mapping from
549                                     MMI service code
550                                     0 means user doesn't input class */
551     int             toa;         /* "type" from TS 27.007 7.11 */
552     char *          number;      /* "number" from TS 27.007 7.11. May be NULL */
553     int             timeSeconds; /* for CF no reply only */
554 }RIL_CallForwardInfo;
555
556 typedef struct {
557    char * cid;         /* Combination of LAC and Cell Id in 32 bits in GSM.
558                         * Upper 16 bits is LAC and lower 16 bits
559                         * is CID (as described in TS 27.005)
560                         * Primary Scrambling Code (as described in TS 25.331)
561                         *         in 9 bits in UMTS
562                         * Valid values are hexadecimal 0x0000 - 0xffffffff.
563                         */
564    int    rssi;        /* Received RSSI in GSM,
565                         * Level index of CPICH Received Signal Code Power in UMTS
566                         */
567 } RIL_NeighboringCell;
568
569 /* See RIL_REQUEST_LAST_CALL_FAIL_CAUSE */
570 typedef enum {
571     CALL_FAIL_UNOBTAINABLE_NUMBER = 1,
572     CALL_FAIL_NORMAL = 16,
573     CALL_FAIL_BUSY = 17,
574     CALL_FAIL_CONGESTION = 34,
575     CALL_FAIL_ACM_LIMIT_EXCEEDED = 68,
576     CALL_FAIL_CALL_BARRED = 240,
577     CALL_FAIL_FDN_BLOCKED = 241,
578     CALL_FAIL_IMSI_UNKNOWN_IN_VLR = 242,
579     CALL_FAIL_IMEI_NOT_ACCEPTED = 243,
580     CALL_FAIL_DIAL_MODIFIED_TO_USSD = 244, /* STK Call Control */
581     CALL_FAIL_DIAL_MODIFIED_TO_SS = 245,
582     CALL_FAIL_DIAL_MODIFIED_TO_DIAL = 246,
583     CALL_FAIL_CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000,
584     CALL_FAIL_CDMA_DROP = 1001,
585     CALL_FAIL_CDMA_INTERCEPT = 1002,
586     CALL_FAIL_CDMA_REORDER = 1003,
587     CALL_FAIL_CDMA_SO_REJECT = 1004,
588     CALL_FAIL_CDMA_RETRY_ORDER = 1005,
589     CALL_FAIL_CDMA_ACCESS_FAILURE = 1006,
590     CALL_FAIL_CDMA_PREEMPTED = 1007,
591     CALL_FAIL_CDMA_NOT_EMERGENCY = 1008, /* For non-emergency number dialed
592                                             during emergency callback mode */
593     CALL_FAIL_CDMA_ACCESS_BLOCKED = 1009, /* CDMA network access probes blocked */
594     CALL_FAIL_ERROR_UNSPECIFIED = 0xffff
595 } RIL_LastCallFailCause;
596
597 /* See RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE */
598 typedef enum {
599     PDP_FAIL_NONE = 0, /* No error, connection ok */
600
601     /* an integer cause code defined in TS 24.008
602        section 6.1.3.1.3 or TS 24.301 Release 8+ Annex B.
603        If the implementation does not have access to the exact cause codes,
604        then it should return one of the following values,
605        as the UI layer needs to distinguish these
606        cases for error notification and potential retries. */
607     PDP_FAIL_OPERATOR_BARRED = 0x08,               /* no retry */
608     PDP_FAIL_INSUFFICIENT_RESOURCES = 0x1A,
609     PDP_FAIL_MISSING_UKNOWN_APN = 0x1B,            /* no retry */
610     PDP_FAIL_UNKNOWN_PDP_ADDRESS_TYPE = 0x1C,      /* no retry */
611     PDP_FAIL_USER_AUTHENTICATION = 0x1D,           /* no retry */
612     PDP_FAIL_ACTIVATION_REJECT_GGSN = 0x1E,        /* no retry */
613     PDP_FAIL_ACTIVATION_REJECT_UNSPECIFIED = 0x1F,
614     PDP_FAIL_SERVICE_OPTION_NOT_SUPPORTED = 0x20,  /* no retry */
615     PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED = 0x21, /* no retry */
616     PDP_FAIL_SERVICE_OPTION_OUT_OF_ORDER = 0x22,
617     PDP_FAIL_NSAPI_IN_USE = 0x23,                  /* no retry */
618     PDP_FAIL_REGULAR_DEACTIVATION = 0x24,          /* possibly restart radio,
619                                                       based on framework config */
620     PDP_FAIL_ONLY_IPV4_ALLOWED = 0x32,             /* no retry */
621     PDP_FAIL_ONLY_IPV6_ALLOWED = 0x33,             /* no retry */
622     PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED = 0x34,
623     PDP_FAIL_PROTOCOL_ERRORS   = 0x6F,             /* no retry */
624
625     /* Not mentioned in the specification */
626     PDP_FAIL_VOICE_REGISTRATION_FAIL = -1,
627     PDP_FAIL_DATA_REGISTRATION_FAIL = -2,
628
629    /* reasons for data call drop - network/modem disconnect */
630     PDP_FAIL_SIGNAL_LOST = -3,
631     PDP_FAIL_PREF_RADIO_TECH_CHANGED = -4,/* preferred technology has changed, should retry
632                                              with parameters appropriate for new technology */
633     PDP_FAIL_RADIO_POWER_OFF = -5,        /* data call was disconnected because radio was resetting,
634                                              powered off - no retry */
635     PDP_FAIL_TETHERED_CALL_ACTIVE = -6,   /* data call was disconnected by modem because tethered
636                                              mode was up on same APN/data profile - no retry until
637                                              tethered call is off */
638
639     PDP_FAIL_ERROR_UNSPECIFIED = 0xffff,  /* retry silently */
640 } RIL_DataCallFailCause;
641
642 /* See RIL_REQUEST_SETUP_DATA_CALL */
643 typedef enum {
644     RIL_DATA_PROFILE_DEFAULT    = 0,
645     RIL_DATA_PROFILE_TETHERED   = 1,
646     RIL_DATA_PROFILE_IMS        = 2,
647     RIL_DATA_PROFILE_FOTA       = 3,
648     RIL_DATA_PROFILE_CBS        = 4,
649     RIL_DATA_PROFILE_OEM_BASE   = 1000,    /* Start of OEM-specific profiles */
650     RIL_DATA_PROFILE_INVALID    = 0xFFFFFFFF
651 } RIL_DataProfile;
652
653 /* Used by RIL_UNSOL_SUPP_SVC_NOTIFICATION */
654 typedef struct {
655     int     notificationType;   /*
656                                  * 0 = MO intermediate result code
657                                  * 1 = MT unsolicited result code
658                                  */
659     int     code;               /* See 27.007 7.17
660                                    "code1" for MO
661                                    "code2" for MT. */
662     int     index;              /* CUG index. See 27.007 7.17. */
663     int     type;               /* "type" from 27.007 7.17 (MT only). */
664     char *  number;             /* "number" from 27.007 7.17
665                                    (MT only, may be NULL). */
666 } RIL_SuppSvcNotification;
667
668 #define RIL_CARD_MAX_APPS     8
669
670 typedef enum {
671     RIL_CARDSTATE_ABSENT   = 0,
672     RIL_CARDSTATE_PRESENT  = 1,
673     RIL_CARDSTATE_ERROR    = 2
674 } RIL_CardState;
675
676 typedef enum {
677     RIL_PERSOSUBSTATE_UNKNOWN                   = 0, /* initial state */
678     RIL_PERSOSUBSTATE_IN_PROGRESS               = 1, /* in between each lock transition */
679     RIL_PERSOSUBSTATE_READY                     = 2, /* when either SIM or RUIM Perso is finished
680                                                         since each app can only have 1 active perso
681                                                         involved */
682     RIL_PERSOSUBSTATE_SIM_NETWORK               = 3,
683     RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET        = 4,
684     RIL_PERSOSUBSTATE_SIM_CORPORATE             = 5,
685     RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER      = 6,
686     RIL_PERSOSUBSTATE_SIM_SIM                   = 7,
687     RIL_PERSOSUBSTATE_SIM_NETWORK_PUK           = 8, /* The corresponding perso lock is blocked */
688     RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET_PUK    = 9,
689     RIL_PERSOSUBSTATE_SIM_CORPORATE_PUK         = 10,
690     RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK  = 11,
691     RIL_PERSOSUBSTATE_SIM_SIM_PUK               = 12,
692     RIL_PERSOSUBSTATE_RUIM_NETWORK1             = 13,
693     RIL_PERSOSUBSTATE_RUIM_NETWORK2             = 14,
694     RIL_PERSOSUBSTATE_RUIM_HRPD                 = 15,
695     RIL_PERSOSUBSTATE_RUIM_CORPORATE            = 16,
696     RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER     = 17,
697     RIL_PERSOSUBSTATE_RUIM_RUIM                 = 18,
698     RIL_PERSOSUBSTATE_RUIM_NETWORK1_PUK         = 19, /* The corresponding perso lock is blocked */
699     RIL_PERSOSUBSTATE_RUIM_NETWORK2_PUK         = 20,
700     RIL_PERSOSUBSTATE_RUIM_HRPD_PUK             = 21,
701     RIL_PERSOSUBSTATE_RUIM_CORPORATE_PUK        = 22,
702     RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER_PUK = 23,
703     RIL_PERSOSUBSTATE_RUIM_RUIM_PUK             = 24
704 } RIL_PersoSubstate;
705
706 typedef enum {
707     RIL_APPSTATE_UNKNOWN               = 0,
708     RIL_APPSTATE_DETECTED              = 1,
709     RIL_APPSTATE_PIN                   = 2, /* If PIN1 or UPin is required */
710     RIL_APPSTATE_PUK                   = 3, /* If PUK1 or Puk for UPin is required */
711     RIL_APPSTATE_SUBSCRIPTION_PERSO    = 4, /* perso_substate should be look at
712                                                when app_state is assigned to this value */
713     RIL_APPSTATE_READY                 = 5
714 } RIL_AppState;
715
716 typedef enum {
717     RIL_PINSTATE_UNKNOWN              = 0,
718     RIL_PINSTATE_ENABLED_NOT_VERIFIED = 1,
719     RIL_PINSTATE_ENABLED_VERIFIED     = 2,
720     RIL_PINSTATE_DISABLED             = 3,
721     RIL_PINSTATE_ENABLED_BLOCKED      = 4,
722     RIL_PINSTATE_ENABLED_PERM_BLOCKED = 5
723 } RIL_PinState;
724
725 typedef enum {
726   RIL_APPTYPE_UNKNOWN = 0,
727   RIL_APPTYPE_SIM     = 1,
728   RIL_APPTYPE_USIM    = 2,
729   RIL_APPTYPE_RUIM    = 3,
730   RIL_APPTYPE_CSIM    = 4,
731   RIL_APPTYPE_ISIM    = 5
732 } RIL_AppType;
733
734 typedef struct
735 {
736   RIL_AppType      app_type;
737   RIL_AppState     app_state;
738   RIL_PersoSubstate perso_substate; /* applicable only if app_state ==
739                                        RIL_APPSTATE_SUBSCRIPTION_PERSO */
740   char             *aid_ptr;        /* null terminated string, e.g., from 0xA0, 0x00 -> 0x41,
741                                        0x30, 0x30, 0x30 */
742   char             *app_label_ptr;  /* null terminated string */
743   int              pin1_replaced;   /* applicable to USIM, CSIM & ISIM */
744   RIL_PinState     pin1;
745   RIL_PinState     pin2;
746 } RIL_AppStatus;
747
748 /* Deprecated, use RIL_CardStatus_v6 */
749 typedef struct
750 {
751   RIL_CardState card_state;
752   RIL_PinState  universal_pin_state;             /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */
753   int           gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */
754   int           cdma_subscription_app_index;     /* value < RIL_CARD_MAX_APPS, -1 if none */
755   int           num_applications;                /* value <= RIL_CARD_MAX_APPS */
756   RIL_AppStatus applications[RIL_CARD_MAX_APPS];
757 } RIL_CardStatus_v5;
758
759 typedef struct
760 {
761   RIL_CardState card_state;
762   RIL_PinState  universal_pin_state;             /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */
763   int           gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */
764   int           cdma_subscription_app_index;     /* value < RIL_CARD_MAX_APPS, -1 if none */
765   int           ims_subscription_app_index;      /* value < RIL_CARD_MAX_APPS, -1 if none */
766   int           num_applications;                /* value <= RIL_CARD_MAX_APPS */
767   RIL_AppStatus applications[RIL_CARD_MAX_APPS];
768 } RIL_CardStatus_v6;
769
770 /** The result of a SIM refresh, returned in data[0] of RIL_UNSOL_SIM_REFRESH
771  *      or as part of RIL_SimRefreshResponse_v7
772  */
773 typedef enum {
774     /* A file on SIM has been updated.  data[1] contains the EFID. */
775     SIM_FILE_UPDATE = 0,
776     /* SIM initialized.  All files should be re-read. */
777     SIM_INIT = 1,
778     /* SIM reset.  SIM power required, SIM may be locked and all files should be re-read. */
779     SIM_RESET = 2
780 } RIL_SimRefreshResult;
781
782 typedef struct {
783     RIL_SimRefreshResult result;
784     int                  ef_id; /* is the EFID of the updated file if the result is */
785                                 /* SIM_FILE_UPDATE or 0 for any other result. */
786     char *               aid;   /* is AID(application ID) of the card application */
787                                 /* See ETSI 102.221 8.1 and 101.220 4 */
788                                 /*     For SIM_FILE_UPDATE result it can be set to AID of */
789                                 /*         application in which updated EF resides or it can be */
790                                 /*         NULL if EF is outside of an application. */
791                                 /*     For SIM_INIT result this field is set to AID of */
792                                 /*         application that caused REFRESH */
793                                 /*     For SIM_RESET result it is NULL. */
794 } RIL_SimRefreshResponse_v7;
795
796 /* Deprecated, use RIL_CDMA_CallWaiting_v6 */
797 typedef struct {
798     char *          number;             /* Remote party number */
799     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown */
800     char *          name;               /* Remote party name */
801     RIL_CDMA_SignalInfoRecord signalInfoRecord;
802 } RIL_CDMA_CallWaiting_v5;
803
804 typedef struct {
805     char *          number;             /* Remote party number */
806     int             numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown */
807     char *          name;               /* Remote party name */
808     RIL_CDMA_SignalInfoRecord signalInfoRecord;
809     /* Number type/Number plan required to support International Call Waiting */
810     int             number_type;        /* 0=Unknown, 1=International, 2=National,
811                                            3=Network specific, 4=subscriber */
812     int             number_plan;        /* 0=Unknown, 1=ISDN, 3=Data, 4=Telex, 8=Nat'l, 9=Private */
813 } RIL_CDMA_CallWaiting_v6;
814
815 /**
816  * Which types of Cell Broadcast Message (CBM) are to be received by the ME
817  *
818  * uFromServiceID - uToServiceID defines a range of CBM message identifiers
819  * whose value is 0x0000 - 0xFFFF as defined in TS 23.041 9.4.1.2.2 for GMS
820  * and 9.4.4.2.2 for UMTS. All other values can be treated as empty
821  * CBM message ID.
822  *
823  * uFromCodeScheme - uToCodeScheme defines a range of CBM data coding schemes
824  * whose value is 0x00 - 0xFF as defined in TS 23.041 9.4.1.2.3 for GMS
825  * and 9.4.4.2.3 for UMTS.
826  * All other values can be treated as empty CBM data coding scheme.
827  *
828  * selected 0 means message types specified in <fromServiceId, toServiceId>
829  * and <fromCodeScheme, toCodeScheme>are not accepted, while 1 means accepted.
830  *
831  * Used by RIL_REQUEST_GSM_GET_BROADCAST_CONFIG and
832  * RIL_REQUEST_GSM_SET_BROADCAST_CONFIG.
833  */
834 typedef struct {
835     int fromServiceId;
836     int toServiceId;
837     int fromCodeScheme;
838     int toCodeScheme;
839     unsigned char selected;
840 } RIL_GSM_BroadcastSmsConfigInfo;
841
842 /* No restriction at all including voice/SMS/USSD/SS/AV64 and packet data. */
843 #define RIL_RESTRICTED_STATE_NONE           0x00
844 /* Block emergency call due to restriction. But allow all normal voice/SMS/USSD/SS/AV64. */
845 #define RIL_RESTRICTED_STATE_CS_EMERGENCY   0x01
846 /* Block all normal voice/SMS/USSD/SS/AV64 due to restriction. Only Emergency call allowed. */
847 #define RIL_RESTRICTED_STATE_CS_NORMAL      0x02
848 /* Block all voice/SMS/USSD/SS/AV64 including emergency call due to restriction.*/
849 #define RIL_RESTRICTED_STATE_CS_ALL         0x04
850 /* Block packet data access due to restriction. */
851 #define RIL_RESTRICTED_STATE_PS_ALL         0x10
852
853 /* The status for an OTASP/OTAPA session */
854 typedef enum {
855     CDMA_OTA_PROVISION_STATUS_SPL_UNLOCKED,
856     CDMA_OTA_PROVISION_STATUS_SPC_RETRIES_EXCEEDED,
857     CDMA_OTA_PROVISION_STATUS_A_KEY_EXCHANGED,
858     CDMA_OTA_PROVISION_STATUS_SSD_UPDATED,
859     CDMA_OTA_PROVISION_STATUS_NAM_DOWNLOADED,
860     CDMA_OTA_PROVISION_STATUS_MDN_DOWNLOADED,
861     CDMA_OTA_PROVISION_STATUS_IMSI_DOWNLOADED,
862     CDMA_OTA_PROVISION_STATUS_PRL_DOWNLOADED,
863     CDMA_OTA_PROVISION_STATUS_COMMITTED,
864     CDMA_OTA_PROVISION_STATUS_OTAPA_STARTED,
865     CDMA_OTA_PROVISION_STATUS_OTAPA_STOPPED,
866     CDMA_OTA_PROVISION_STATUS_OTAPA_ABORTED
867 } RIL_CDMA_OTA_ProvisionStatus;
868
869 typedef struct {
870     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
871     int bitErrorRate;    /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */
872 } RIL_GW_SignalStrength;
873
874 typedef struct {
875     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
876     int bitErrorRate;    /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */
877 } RIL_SignalStrengthWcdma;
878
879 typedef struct {
880     int dbm;  /* Valid values are positive integers.  This value is the actual RSSI value
881                * multiplied by -1.  Example: If the actual RSSI is -75, then this response
882                * value will be 75.
883                */
884     int ecio; /* Valid values are positive integers.  This value is the actual Ec/Io multiplied
885                * by -10.  Example: If the actual Ec/Io is -12.5 dB, then this response value
886                * will be 125.
887                */
888 } RIL_CDMA_SignalStrength;
889
890
891 typedef struct {
892     int dbm;  /* Valid values are positive integers.  This value is the actual RSSI value
893                * multiplied by -1.  Example: If the actual RSSI is -75, then this response
894                * value will be 75.
895                */
896     int ecio; /* Valid values are positive integers.  This value is the actual Ec/Io multiplied
897                * by -10.  Example: If the actual Ec/Io is -12.5 dB, then this response value
898                * will be 125.
899                */
900     int signalNoiseRatio; /* Valid values are 0-8.  8 is the highest signal to noise ratio. */
901 } RIL_EVDO_SignalStrength;
902
903 typedef struct {
904     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
905     int rsrp;            /* The current Reference Signal Receive Power in dBm multipled by -1.
906                           * Range: 44 to 140 dBm
907                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
908                           * Reference: 3GPP TS 36.133 9.1.4 */
909     int rsrq;            /* The current Reference Signal Receive Quality in dB multiplied by -1.
910                           * Range: 20 to 3 dB.
911                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
912                           * Reference: 3GPP TS 36.133 9.1.7 */
913     int rssnr;           /* The current reference signal signal-to-noise ratio in 0.1 dB units.
914                           * Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB).
915                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
916                           * Reference: 3GPP TS 36.101 8.1.1 */
917     int cqi;             /* The current Channel Quality Indicator.
918                           * Range: 0 to 15.
919                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
920                           * Reference: 3GPP TS 36.101 9.2, 9.3, A.4 */
921 } RIL_LTE_SignalStrength;
922
923 typedef struct {
924     int signalStrength;  /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */
925     int rsrp;            /* The current Reference Signal Receive Power in dBm multipled by -1.
926                           * Range: 44 to 140 dBm
927                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
928                           * Reference: 3GPP TS 36.133 9.1.4 */
929     int rsrq;            /* The current Reference Signal Receive Quality in dB multiplied by -1.
930                           * Range: 20 to 3 dB.
931                           * INT_MAX: 0x7FFFFFFF denotes invalid value.
932                           * Reference: 3GPP TS 36.133 9.1.7 */
933     int rssnr;           /* The current reference signal signal-to-noise ratio in 0.1 dB units.
934                           * Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB).
935                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
936                           * Reference: 3GPP TS 36.101 8.1.1 */
937     int cqi;             /* The current Channel Quality Indicator.
938                           * Range: 0 to 15.
939                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
940                           * Reference: 3GPP TS 36.101 9.2, 9.3, A.4 */
941     int timingAdvance;   /* timing advance in micro seconds for a one way trip from cell to device.
942                           * Approximate distance can be calculated using 300m/us * timingAdvance.
943                           * Range: 0 to 0x7FFFFFFE
944                           * INT_MAX : 0x7FFFFFFF denotes invalid value.
945                           * Reference: 3GPP 36.321 section 6.1.3.5
946                           * also: http://www.cellular-planningoptimization.com/2010/02/timing-advance-with-calculation.html */
947 } RIL_LTE_SignalStrength_v8;
948
949 typedef struct {
950     int rscp;    /* The Received Signal Code Power in dBm multipled by -1.
951                   * Range : 25 to 120
952                   * INT_MAX: 0x7FFFFFFF denotes invalid value.
953                   * Reference: 3GPP TS 25.123, section 9.1.1.1 */
954 } RIL_TD_SCDMA_SignalStrength;
955
956 /* Deprecated, use RIL_SignalStrength_v6 */
957 typedef struct {
958     RIL_GW_SignalStrength   GW_SignalStrength;
959     RIL_CDMA_SignalStrength CDMA_SignalStrength;
960     RIL_EVDO_SignalStrength EVDO_SignalStrength;
961 } RIL_SignalStrength_v5;
962
963 typedef struct {
964     RIL_GW_SignalStrength   GW_SignalStrength;
965     RIL_CDMA_SignalStrength CDMA_SignalStrength;
966     RIL_EVDO_SignalStrength EVDO_SignalStrength;
967     RIL_LTE_SignalStrength  LTE_SignalStrength;
968 } RIL_SignalStrength_v6;
969
970 typedef struct {
971     RIL_GW_SignalStrength       GW_SignalStrength;
972     RIL_CDMA_SignalStrength     CDMA_SignalStrength;
973     RIL_EVDO_SignalStrength     EVDO_SignalStrength;
974     RIL_LTE_SignalStrength_v8   LTE_SignalStrength;
975 } RIL_SignalStrength_v8;
976
977 typedef struct {
978     RIL_GW_SignalStrength       GW_SignalStrength;
979     RIL_CDMA_SignalStrength     CDMA_SignalStrength;
980     RIL_EVDO_SignalStrength     EVDO_SignalStrength;
981     RIL_LTE_SignalStrength_v8   LTE_SignalStrength;
982     RIL_TD_SCDMA_SignalStrength TD_SCDMA_SignalStrength;
983 } RIL_SignalStrength_v10;
984
985 /** RIL_CellIdentityGsm */
986 typedef struct {
987     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */
988     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown */
989     int lac;    /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown  */
990     int cid;    /* 16-bit GSM Cell Identity described in TS 27.007, 0..65535, INT_MAX if unknown  */
991 } RIL_CellIdentityGsm;
992
993 /** RIL_CellIdentityWcdma */
994 typedef struct {
995     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown  */
996     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown  */
997     int lac;    /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown  */
998     int cid;    /* 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown  */
999     int psc;    /* 9-bit UMTS Primary Scrambling Code described in TS 25.331, 0..511, INT_MAX if unknown */
1000 } RIL_CellIdentityWcdma;
1001
1002 /** RIL_CellIdentityCdma */
1003 typedef struct {
1004     int networkId;      /* Network Id 0..65535, INT_MAX if unknown */
1005     int systemId;       /* CDMA System Id 0..32767, INT_MAX if unknown  */
1006     int basestationId;  /* Base Station Id 0..65535, INT_MAX if unknown  */
1007     int longitude;      /* Longitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0.
1008                          * It is represented in units of 0.25 seconds and ranges from -2592000
1009                          * to 2592000, both values inclusive (corresponding to a range of -180
1010                          * to +180 degrees). INT_MAX if unknown */
1011
1012     int latitude;       /* Latitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0.
1013                          * It is represented in units of 0.25 seconds and ranges from -1296000
1014                          * to 1296000, both values inclusive (corresponding to a range of -90
1015                          * to +90 degrees). INT_MAX if unknown */
1016 } RIL_CellIdentityCdma;
1017
1018 /** RIL_CellIdentityLte */
1019 typedef struct {
1020     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown  */
1021     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown  */
1022     int ci;     /* 28-bit Cell Identity described in TS ???, INT_MAX if unknown */
1023     int pci;    /* physical cell id 0..503, INT_MAX if unknown  */
1024     int tac;    /* 16-bit tracking area code, INT_MAX if unknown  */
1025 } RIL_CellIdentityLte;
1026
1027 /** RIL_CellIdentityTdscdma */
1028 typedef struct {
1029     int mcc;    /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown  */
1030     int mnc;    /* 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if unknown  */
1031     int lac;    /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown  */
1032     int cid;    /* 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown  */
1033     int cpid;    /* 8-bit Cell Parameters ID described in TS 25.331, 0..127, INT_MAX if unknown */
1034 } RIL_CellIdentityTdscdma;
1035
1036 /** RIL_CellInfoGsm */
1037 typedef struct {
1038   RIL_CellIdentityGsm   cellIdentityGsm;
1039   RIL_GW_SignalStrength signalStrengthGsm;
1040 } RIL_CellInfoGsm;
1041
1042 /** RIL_CellInfoWcdma */
1043 typedef struct {
1044   RIL_CellIdentityWcdma cellIdentityWcdma;
1045   RIL_SignalStrengthWcdma signalStrengthWcdma;
1046 } RIL_CellInfoWcdma;
1047
1048 /** RIL_CellInfoCdma */
1049 typedef struct {
1050   RIL_CellIdentityCdma      cellIdentityCdma;
1051   RIL_CDMA_SignalStrength   signalStrengthCdma;
1052   RIL_EVDO_SignalStrength   signalStrengthEvdo;
1053 } RIL_CellInfoCdma;
1054
1055 /** RIL_CellInfoLte */
1056 typedef struct {
1057   RIL_CellIdentityLte        cellIdentityLte;
1058   RIL_LTE_SignalStrength_v8  signalStrengthLte;
1059 } RIL_CellInfoLte;
1060
1061 /** RIL_CellInfoTdscdma */
1062 typedef struct {
1063   RIL_CellIdentityTdscdma cellIdentityTdscdma;
1064   RIL_TD_SCDMA_SignalStrength signalStrengthTdscdma;
1065 } RIL_CellInfoTdscdma;
1066
1067 // Must be the same as CellInfo.TYPE_XXX
1068 typedef enum {
1069   RIL_CELL_INFO_TYPE_GSM    = 1,
1070   RIL_CELL_INFO_TYPE_CDMA   = 2,
1071   RIL_CELL_INFO_TYPE_LTE    = 3,
1072   RIL_CELL_INFO_TYPE_WCDMA  = 4,
1073   RIL_CELL_INFO_TYPE_TD_SCDMA  = 5
1074 } RIL_CellInfoType;
1075
1076 // Must be the same as CellInfo.TIMESTAMP_TYPE_XXX
1077 typedef enum {
1078     RIL_TIMESTAMP_TYPE_UNKNOWN = 0,
1079     RIL_TIMESTAMP_TYPE_ANTENNA = 1,
1080     RIL_TIMESTAMP_TYPE_MODEM = 2,
1081     RIL_TIMESTAMP_TYPE_OEM_RIL = 3,
1082     RIL_TIMESTAMP_TYPE_JAVA_RIL = 4,
1083 } RIL_TimeStampType;
1084
1085 typedef struct {
1086   RIL_CellInfoType  cellInfoType;   /* cell type for selecting from union CellInfo */
1087   int               registered;     /* !0 if this cell is registered 0 if not registered */
1088   RIL_TimeStampType timeStampType;  /* type of time stamp represented by timeStamp */
1089   uint64_t          timeStamp;      /* Time in nanos as returned by ril_nano_time */
1090   union {
1091     RIL_CellInfoGsm     gsm;
1092     RIL_CellInfoCdma    cdma;
1093     RIL_CellInfoLte     lte;
1094     RIL_CellInfoWcdma   wcdma;
1095     RIL_CellInfoTdscdma tdscdma;
1096   } CellInfo;
1097 } RIL_CellInfo;
1098
1099 /* Names of the CDMA info records (C.S0005 section 3.7.5) */
1100 typedef enum {
1101   RIL_CDMA_DISPLAY_INFO_REC,
1102   RIL_CDMA_CALLED_PARTY_NUMBER_INFO_REC,
1103   RIL_CDMA_CALLING_PARTY_NUMBER_INFO_REC,
1104   RIL_CDMA_CONNECTED_NUMBER_INFO_REC,
1105   RIL_CDMA_SIGNAL_INFO_REC,
1106   RIL_CDMA_REDIRECTING_NUMBER_INFO_REC,
1107   RIL_CDMA_LINE_CONTROL_INFO_REC,
1108   RIL_CDMA_EXTENDED_DISPLAY_INFO_REC,
1109   RIL_CDMA_T53_CLIR_INFO_REC,
1110   RIL_CDMA_T53_RELEASE_INFO_REC,
1111   RIL_CDMA_T53_AUDIO_CONTROL_INFO_REC
1112 } RIL_CDMA_InfoRecName;
1113
1114 /* Display Info Rec as defined in C.S0005 section 3.7.5.1
1115    Extended Display Info Rec as defined in C.S0005 section 3.7.5.16
1116    Note: the Extended Display info rec contains multiple records of the
1117    form: display_tag, display_len, and display_len occurrences of the
1118    chari field if the display_tag is not 10000000 or 10000001.
1119    To save space, the records are stored consecutively in a byte buffer.
1120    The display_tag, display_len and chari fields are all 1 byte.
1121 */
1122
1123 typedef struct {
1124   char alpha_len;
1125   char alpha_buf[CDMA_ALPHA_INFO_BUFFER_LENGTH];
1126 } RIL_CDMA_DisplayInfoRecord;
1127
1128 /* Called Party Number Info Rec as defined in C.S0005 section 3.7.5.2
1129    Calling Party Number Info Rec as defined in C.S0005 section 3.7.5.3
1130    Connected Number Info Rec as defined in C.S0005 section 3.7.5.4
1131 */
1132
1133 typedef struct {
1134   char len;
1135   char buf[CDMA_NUMBER_INFO_BUFFER_LENGTH];
1136   char number_type;
1137   char number_plan;
1138   char pi;
1139   char si;
1140 } RIL_CDMA_NumberInfoRecord;
1141
1142 /* Redirecting Number Information Record as defined in C.S0005 section 3.7.5.11 */
1143 typedef enum {
1144   RIL_REDIRECTING_REASON_UNKNOWN = 0,
1145   RIL_REDIRECTING_REASON_CALL_FORWARDING_BUSY = 1,
1146   RIL_REDIRECTING_REASON_CALL_FORWARDING_NO_REPLY = 2,
1147   RIL_REDIRECTING_REASON_CALLED_DTE_OUT_OF_ORDER = 9,
1148   RIL_REDIRECTING_REASON_CALL_FORWARDING_BY_THE_CALLED_DTE = 10,
1149   RIL_REDIRECTING_REASON_CALL_FORWARDING_UNCONDITIONAL = 15,
1150   RIL_REDIRECTING_REASON_RESERVED
1151 } RIL_CDMA_RedirectingReason;
1152
1153 typedef struct {
1154   RIL_CDMA_NumberInfoRecord redirectingNumber;
1155   /* redirectingReason is set to RIL_REDIRECTING_REASON_UNKNOWN if not included */
1156   RIL_CDMA_RedirectingReason redirectingReason;
1157 } RIL_CDMA_RedirectingNumberInfoRecord;
1158
1159 /* Line Control Information Record as defined in C.S0005 section 3.7.5.15 */
1160 typedef struct {
1161   char lineCtrlPolarityIncluded;
1162   char lineCtrlToggle;
1163   char lineCtrlReverse;
1164   char lineCtrlPowerDenial;
1165 } RIL_CDMA_LineControlInfoRecord;
1166
1167 /* T53 CLIR Information Record */
1168 typedef struct {
1169   char cause;
1170 } RIL_CDMA_T53_CLIRInfoRecord;
1171
1172 /* T53 Audio Control Information Record */
1173 typedef struct {
1174   char upLink;
1175   char downLink;
1176 } RIL_CDMA_T53_AudioControlInfoRecord;
1177
1178 typedef struct {
1179
1180   RIL_CDMA_InfoRecName name;
1181
1182   union {
1183     /* Display and Extended Display Info Rec */
1184     RIL_CDMA_DisplayInfoRecord           display;
1185
1186     /* Called Party Number, Calling Party Number, Connected Number Info Rec */
1187     RIL_CDMA_NumberInfoRecord            number;
1188
1189     /* Signal Info Rec */
1190     RIL_CDMA_SignalInfoRecord            signal;
1191
1192     /* Redirecting Number Info Rec */
1193     RIL_CDMA_RedirectingNumberInfoRecord redir;
1194
1195     /* Line Control Info Rec */
1196     RIL_CDMA_LineControlInfoRecord       lineCtrl;
1197
1198     /* T53 CLIR Info Rec */
1199     RIL_CDMA_T53_CLIRInfoRecord          clir;
1200
1201     /* T53 Audio Control Info Rec */
1202     RIL_CDMA_T53_AudioControlInfoRecord  audioCtrl;
1203   } rec;
1204 } RIL_CDMA_InformationRecord;
1205
1206 #define RIL_CDMA_MAX_NUMBER_OF_INFO_RECS 10
1207
1208 typedef struct {
1209   char numberOfInfoRecs;
1210   RIL_CDMA_InformationRecord infoRec[RIL_CDMA_MAX_NUMBER_OF_INFO_RECS];
1211 } RIL_CDMA_InformationRecords;
1212
1213 /* See RIL_REQUEST_NV_READ_ITEM */
1214 typedef struct {
1215   RIL_NV_Item itemID;
1216 } RIL_NV_ReadItem;
1217
1218 /* See RIL_REQUEST_NV_WRITE_ITEM */
1219 typedef struct {
1220   RIL_NV_Item   itemID;
1221   char *        value;
1222 } RIL_NV_WriteItem;
1223
1224 typedef enum {
1225     HANDOVER_STARTED = 0,
1226     HANDOVER_COMPLETED = 1,
1227     HANDOVER_FAILED = 2,
1228     HANDOVER_CANCELED = 3
1229 } RIL_SrvccState;
1230
1231 /* hardware configuration reported to RILJ. */
1232 typedef enum {
1233    RIL_HARDWARE_CONFIG_MODEM = 0,
1234    RIL_HARDWARE_CONFIG_SIM = 1,
1235 } RIL_HardwareConfig_Type;
1236
1237 typedef enum {
1238    RIL_HARDWARE_CONFIG_STATE_ENABLED = 0,
1239    RIL_HARDWARE_CONFIG_STATE_STANDBY = 1,
1240    RIL_HARDWARE_CONFIG_STATE_DISABLED = 2,
1241 } RIL_HardwareConfig_State;
1242
1243 typedef struct {
1244    int rilModel;
1245    uint32_t rat; /* bitset - ref. RIL_RadioTechnology. */
1246    int maxVoice;
1247    int maxData;
1248    int maxStandby;
1249 } RIL_HardwareConfig_Modem;
1250
1251 typedef struct {
1252    char modemUuid[MAX_UUID_LENGTH];
1253 } RIL_HardwareConfig_Sim;
1254
1255 typedef struct {
1256   RIL_HardwareConfig_Type type;
1257   char uuid[MAX_UUID_LENGTH];
1258   RIL_HardwareConfig_State state;
1259   union {
1260      RIL_HardwareConfig_Modem modem;
1261      RIL_HardwareConfig_Sim sim;
1262   } cfg;
1263 } RIL_HardwareConfig;
1264
1265 typedef enum {
1266   SS_CFU,
1267   SS_CF_BUSY,
1268   SS_CF_NO_REPLY,
1269   SS_CF_NOT_REACHABLE,
1270   SS_CF_ALL,
1271   SS_CF_ALL_CONDITIONAL,
1272   SS_CLIP,
1273   SS_CLIR,
1274   SS_COLP,
1275   SS_COLR,
1276   SS_WAIT,
1277   SS_BAOC,
1278   SS_BAOIC,
1279   SS_BAOIC_EXC_HOME,
1280   SS_BAIC,
1281   SS_BAIC_ROAMING,
1282   SS_ALL_BARRING,
1283   SS_OUTGOING_BARRING,
1284   SS_INCOMING_BARRING
1285 } RIL_SsServiceType;
1286
1287 typedef enum {
1288   SS_ACTIVATION,
1289   SS_DEACTIVATION,
1290   SS_INTERROGATION,
1291   SS_REGISTRATION,
1292   SS_ERASURE
1293 } RIL_SsRequestType;
1294
1295 typedef enum {
1296   SS_ALL_TELE_AND_BEARER_SERVICES,
1297   SS_ALL_TELESEVICES,
1298   SS_TELEPHONY,
1299   SS_ALL_DATA_TELESERVICES,
1300   SS_SMS_SERVICES,
1301   SS_ALL_TELESERVICES_EXCEPT_SMS
1302 } RIL_SsTeleserviceType;
1303
1304 #define SS_INFO_MAX 4
1305 #define NUM_SERVICE_CLASSES 7
1306
1307 typedef struct {
1308   int numValidIndexes; /* This gives the number of valid values in cfInfo.
1309                        For example if voice is forwarded to one number and data
1310                        is forwarded to a different one then numValidIndexes will be
1311                        2 indicating total number of valid values in cfInfo.
1312                        Similarly if all the services are forwarded to the same
1313                        number then the value of numValidIndexes will be 1. */
1314
1315   RIL_CallForwardInfo cfInfo[NUM_SERVICE_CLASSES]; /* This is the response data
1316                                                       for SS request to query call
1317                                                       forward status. see
1318                                                       RIL_REQUEST_QUERY_CALL_FORWARD_STATUS */
1319 } RIL_CfData;
1320
1321 typedef struct {
1322   RIL_SsServiceType serviceType;
1323   RIL_SsRequestType requestType;
1324   RIL_SsTeleserviceType teleserviceType;
1325   int serviceClass;
1326   RIL_Errno result;
1327
1328   union {
1329     int ssInfo[SS_INFO_MAX]; /* This is the response data for most of the SS GET/SET
1330                                 RIL requests. E.g. RIL_REQUSET_GET_CLIR returns
1331                                 two ints, so first two values of ssInfo[] will be
1332                                 used for response if serviceType is SS_CLIR and
1333                                 requestType is SS_INTERROGATION */
1334
1335     RIL_CfData cfData;
1336   };
1337 } RIL_StkCcUnsolSsResponse;
1338
1339 /**
1340  * Data connection power state
1341  */
1342 typedef enum {
1343     RIL_DC_POWER_STATE_LOW      = 1,        // Low power state
1344     RIL_DC_POWER_STATE_MEDIUM   = 2,        // Medium power state
1345     RIL_DC_POWER_STATE_HIGH     = 3,        // High power state
1346     RIL_DC_POWER_STATE_UNKNOWN  = INT32_MAX // Unknown state
1347 } RIL_DcPowerStates;
1348
1349 /**
1350  * Data connection real time info
1351  */
1352 typedef struct {
1353     uint64_t                    time;       // Time in nanos as returned by ril_nano_time
1354     RIL_DcPowerStates           powerState; // Current power state
1355 } RIL_DcRtInfo;
1356
1357 /**
1358  * Data profile to modem
1359  */
1360 typedef struct {
1361     /* id of the data profile */
1362     int profileId;
1363     /* the APN to connect to */
1364     char* apn;
1365     /** one of the PDP_type values in TS 27.007 section 10.1.1.
1366      * For example, "IP", "IPV6", "IPV4V6", or "PPP".
1367      */
1368     char* protocol;
1369     /** authentication protocol used for this PDP context
1370      * (None: 0, PAP: 1, CHAP: 2, PAP&CHAP: 3)
1371      */
1372     int authType;
1373     /* the username for APN, or NULL */
1374     char* user;
1375     /* the password for APN, or NULL */
1376     char* password;
1377     /* the profile type, TYPE_COMMON-0, TYPE_3GPP-1, TYPE_3GPP2-2 */
1378     int type;
1379     /* the period in seconds to limit the maximum connections */
1380     int maxConnsTime;
1381     /* the maximum connections during maxConnsTime */
1382     int maxConns;
1383     /** the required wait time in seconds after a successful UE initiated
1384      * disconnect of a given PDN connection before the device can send
1385      * a new PDN connection request for that given PDN
1386      */
1387     int waitTime;
1388     /* true to enable the profile, 0 to disable, 1 to enable */
1389     int enabled;
1390 } RIL_DataProfileInfo;
1391
1392 /**
1393  * RIL_REQUEST_GET_SIM_STATUS
1394  *
1395  * Requests status of the SIM interface and the SIM card
1396  *
1397  * "data" is NULL
1398  *
1399  * "response" is const RIL_CardStatus_v6 *
1400  *
1401  * Valid errors:
1402  *  Must never fail
1403  */
1404 #define RIL_REQUEST_GET_SIM_STATUS 1
1405
1406 /**
1407  * RIL_REQUEST_ENTER_SIM_PIN
1408  *
1409  * Supplies SIM PIN. Only called if RIL_CardStatus has RIL_APPSTATE_PIN state
1410  *
1411  * "data" is const char **
1412  * ((const char **)data)[0] is PIN value
1413  * ((const char **)data)[1] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
1414  *
1415  * "response" is int *
1416  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
1417  *
1418  * Valid errors:
1419  *
1420  * SUCCESS
1421  * RADIO_NOT_AVAILABLE (radio resetting)
1422  * GENERIC_FAILURE
1423  * PASSWORD_INCORRECT
1424  */
1425
1426 #define RIL_REQUEST_ENTER_SIM_PIN 2
1427
1428 /**
1429  * RIL_REQUEST_ENTER_SIM_PUK
1430  *
1431  * Supplies SIM PUK and new PIN.
1432  *
1433  * "data" is const char **
1434  * ((const char **)data)[0] is PUK value
1435  * ((const char **)data)[1] is new PIN value
1436  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
1437  *
1438  * "response" is int *
1439  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
1440  *
1441  * Valid errors:
1442  *
1443  *  SUCCESS
1444  *  RADIO_NOT_AVAILABLE (radio resetting)
1445  *  GENERIC_FAILURE
1446  *  PASSWORD_INCORRECT
1447  *     (PUK is invalid)
1448  */
1449
1450 #define RIL_REQUEST_ENTER_SIM_PUK 3
1451
1452 /**
1453  * RIL_REQUEST_ENTER_SIM_PIN2
1454  *
1455  * Supplies SIM PIN2. Only called following operation where SIM_PIN2 was
1456  * returned as a a failure from a previous operation.
1457  *
1458  * "data" is const char **
1459  * ((const char **)data)[0] is PIN2 value
1460  * ((const char **)data)[1] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
1461  *
1462  * "response" is int *
1463  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
1464  *
1465  * Valid errors:
1466  *
1467  *  SUCCESS
1468  *  RADIO_NOT_AVAILABLE (radio resetting)
1469  *  GENERIC_FAILURE
1470  *  PASSWORD_INCORRECT
1471  */
1472
1473 #define RIL_REQUEST_ENTER_SIM_PIN2 4
1474
1475 /**
1476  * RIL_REQUEST_ENTER_SIM_PUK2
1477  *
1478  * Supplies SIM PUK2 and new PIN2.
1479  *
1480  * "data" is const char **
1481  * ((const char **)data)[0] is PUK2 value
1482  * ((const char **)data)[1] is new PIN2 value
1483  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
1484  *
1485  * "response" is int *
1486  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
1487  *
1488  * Valid errors:
1489  *
1490  *  SUCCESS
1491  *  RADIO_NOT_AVAILABLE (radio resetting)
1492  *  GENERIC_FAILURE
1493  *  PASSWORD_INCORRECT
1494  *     (PUK2 is invalid)
1495  */
1496
1497 #define RIL_REQUEST_ENTER_SIM_PUK2 5
1498
1499 /**
1500  * RIL_REQUEST_CHANGE_SIM_PIN
1501  *
1502  * Supplies old SIM PIN and new PIN.
1503  *
1504  * "data" is const char **
1505  * ((const char **)data)[0] is old PIN value
1506  * ((const char **)data)[1] is new PIN value
1507  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
1508  *
1509  * "response" is int *
1510  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
1511  *
1512  * Valid errors:
1513  *
1514  *  SUCCESS
1515  *  RADIO_NOT_AVAILABLE (radio resetting)
1516  *  GENERIC_FAILURE
1517  *  PASSWORD_INCORRECT
1518  *     (old PIN is invalid)
1519  *
1520  */
1521
1522 #define RIL_REQUEST_CHANGE_SIM_PIN 6
1523
1524
1525 /**
1526  * RIL_REQUEST_CHANGE_SIM_PIN2
1527  *
1528  * Supplies old SIM PIN2 and new PIN2.
1529  *
1530  * "data" is const char **
1531  * ((const char **)data)[0] is old PIN2 value
1532  * ((const char **)data)[1] is new PIN2 value
1533  * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
1534  *
1535  * "response" is int *
1536  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
1537  *
1538  * Valid errors:
1539  *
1540  *  SUCCESS
1541  *  RADIO_NOT_AVAILABLE (radio resetting)
1542  *  GENERIC_FAILURE
1543  *  PASSWORD_INCORRECT
1544  *     (old PIN2 is invalid)
1545  *
1546  */
1547
1548 #define RIL_REQUEST_CHANGE_SIM_PIN2 7
1549
1550 /**
1551  * RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION
1552  *
1553  * Requests that network personlization be deactivated
1554  *
1555  * "data" is const char **
1556  * ((const char **)(data))[0]] is network depersonlization code
1557  *
1558  * "response" is int *
1559  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
1560  *
1561  * Valid errors:
1562  *
1563  *  SUCCESS
1564  *  RADIO_NOT_AVAILABLE (radio resetting)
1565  *  GENERIC_FAILURE
1566  *  PASSWORD_INCORRECT
1567  *     (code is invalid)
1568  */
1569
1570 #define RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION 8
1571
1572 /**
1573  * RIL_REQUEST_GET_CURRENT_CALLS
1574  *
1575  * Requests current call list
1576  *
1577  * "data" is NULL
1578  *
1579  * "response" must be a "const RIL_Call **"
1580  *
1581  * Valid errors:
1582  *
1583  *  SUCCESS
1584  *  RADIO_NOT_AVAILABLE (radio resetting)
1585  *  GENERIC_FAILURE
1586  *      (request will be made again in a few hundred msec)
1587  */
1588
1589 #define RIL_REQUEST_GET_CURRENT_CALLS 9
1590
1591
1592 /**
1593  * RIL_REQUEST_DIAL
1594  *
1595  * Initiate voice call
1596  *
1597  * "data" is const RIL_Dial *
1598  * "response" is NULL
1599  *
1600  * This method is never used for supplementary service codes
1601  *
1602  * Valid errors:
1603  *  SUCCESS
1604  *  RADIO_NOT_AVAILABLE (radio resetting)
1605  *  DIAL_MODIFIED_TO_USSD
1606  *  DIAL_MODIFIED_TO_SS
1607  *  DIAL_MODIFIED_TO_DIAL
1608  *  GENERIC_FAILURE
1609  */
1610 #define RIL_REQUEST_DIAL 10
1611
1612 /**
1613  * RIL_REQUEST_GET_IMSI
1614  *
1615  * Get the SIM IMSI
1616  *
1617  * Only valid when radio state is "RADIO_STATE_ON"
1618  *
1619  * "data" is const char **
1620  * ((const char **)data)[0] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
1621  * "response" is a const char * containing the IMSI
1622  *
1623  * Valid errors:
1624  *  SUCCESS
1625  *  RADIO_NOT_AVAILABLE (radio resetting)
1626  *  GENERIC_FAILURE
1627  */
1628
1629 #define RIL_REQUEST_GET_IMSI 11
1630
1631 /**
1632  * RIL_REQUEST_HANGUP
1633  *
1634  * Hang up a specific line (like AT+CHLD=1x)
1635  *
1636  * After this HANGUP request returns, RIL should show the connection is NOT
1637  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
1638  *
1639  * "data" is an int *
1640  * (int *)data)[0] contains Connection index (value of 'x' in CHLD above)
1641  *
1642  * "response" is NULL
1643  *
1644  * Valid errors:
1645  *  SUCCESS
1646  *  RADIO_NOT_AVAILABLE (radio resetting)
1647  *  GENERIC_FAILURE
1648  */
1649
1650 #define RIL_REQUEST_HANGUP 12
1651
1652 /**
1653  * RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND
1654  *
1655  * Hang up waiting or held (like AT+CHLD=0)
1656  *
1657  * After this HANGUP request returns, RIL should show the connection is NOT
1658  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
1659  *
1660  * "data" is NULL
1661  * "response" is NULL
1662  *
1663  * Valid errors:
1664  *  SUCCESS
1665  *  RADIO_NOT_AVAILABLE (radio resetting)
1666  *  GENERIC_FAILURE
1667  */
1668
1669 #define RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND 13
1670
1671 /**
1672  * RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND
1673  *
1674  * Hang up waiting or held (like AT+CHLD=1)
1675  *
1676  * After this HANGUP request returns, RIL should show the connection is NOT
1677  * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query.
1678  *
1679  * "data" is NULL
1680  * "response" is NULL
1681  *
1682  * Valid errors:
1683  *  SUCCESS
1684  *  RADIO_NOT_AVAILABLE (radio resetting)
1685  *  GENERIC_FAILURE
1686  */
1687
1688 #define RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND 14
1689
1690 /**
1691  * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE
1692  *
1693  * Switch waiting or holding call and active call (like AT+CHLD=2)
1694  *
1695  * State transitions should be is follows:
1696  *
1697  * If call 1 is waiting and call 2 is active, then if this re
1698  *
1699  *   BEFORE                               AFTER
1700  * Call 1   Call 2                 Call 1       Call 2
1701  * ACTIVE   HOLDING                HOLDING     ACTIVE
1702  * ACTIVE   WAITING                HOLDING     ACTIVE
1703  * HOLDING  WAITING                HOLDING     ACTIVE
1704  * ACTIVE   IDLE                   HOLDING     IDLE
1705  * IDLE     IDLE                   IDLE        IDLE
1706  *
1707  * "data" is NULL
1708  * "response" is NULL
1709  *
1710  * Valid errors:
1711  *  SUCCESS
1712  *  RADIO_NOT_AVAILABLE (radio resetting)
1713  *  GENERIC_FAILURE
1714  */
1715
1716 #define RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE 15
1717 #define RIL_REQUEST_SWITCH_HOLDING_AND_ACTIVE 15
1718
1719 /**
1720  * RIL_REQUEST_CONFERENCE
1721  *
1722  * Conference holding and active (like AT+CHLD=3)
1723
1724  * "data" is NULL
1725  * "response" is NULL
1726  *
1727  * Valid errors:
1728  *  SUCCESS
1729  *  RADIO_NOT_AVAILABLE (radio resetting)
1730  *  GENERIC_FAILURE
1731  */
1732 #define RIL_REQUEST_CONFERENCE 16
1733
1734 /**
1735  * RIL_REQUEST_UDUB
1736  *
1737  * Send UDUB (user determined used busy) to ringing or
1738  * waiting call answer)(RIL_BasicRequest r);
1739  *
1740  * "data" is NULL
1741  * "response" is NULL
1742  *
1743  * Valid errors:
1744  *  SUCCESS
1745  *  RADIO_NOT_AVAILABLE (radio resetting)
1746  *  GENERIC_FAILURE
1747  */
1748 #define RIL_REQUEST_UDUB 17
1749
1750 /**
1751  * RIL_REQUEST_LAST_CALL_FAIL_CAUSE
1752  *
1753  * Requests the failure cause code for the most recently terminated call
1754  *
1755  * "data" is NULL
1756  * "response" is a "int *"
1757  * ((int *)response)[0] is RIL_LastCallFailCause.  GSM failure reasons are
1758  * mapped to cause codes defined in TS 24.008 Annex H where possible. CDMA
1759  * failure reasons are derived from the possible call failure scenarios
1760  * described in the "CDMA IS-2000 Release A (C.S0005-A v6.0)" standard.
1761  *
1762  * The implementation should return CALL_FAIL_ERROR_UNSPECIFIED for blocked
1763  * MO calls by restricted state (See RIL_UNSOL_RESTRICTED_STATE_CHANGED)
1764  *
1765  * If the implementation does not have access to the exact cause codes,
1766  * then it should return one of the values listed in RIL_LastCallFailCause,
1767  * as the UI layer needs to distinguish these cases for tone generation or
1768  * error notification.
1769  *
1770  * Valid errors:
1771  *  SUCCESS
1772  *  RADIO_NOT_AVAILABLE
1773  *  GENERIC_FAILURE
1774  *
1775  * See also: RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE
1776  */
1777 #define RIL_REQUEST_LAST_CALL_FAIL_CAUSE 18
1778
1779 /**
1780  * RIL_REQUEST_SIGNAL_STRENGTH
1781  *
1782  * Requests current signal strength and associated information
1783  *
1784  * Must succeed if radio is on.
1785  *
1786  * "data" is NULL
1787  *
1788  * "response" is a const RIL_SignalStrength *
1789  *
1790  * Valid errors:
1791  *  SUCCESS
1792  *  RADIO_NOT_AVAILABLE
1793  */
1794 #define RIL_REQUEST_SIGNAL_STRENGTH 19
1795
1796 /**
1797  * RIL_REQUEST_VOICE_REGISTRATION_STATE
1798  *
1799  * Request current registration state
1800  *
1801  * "data" is NULL
1802  * "response" is a "char **"
1803  * ((const char **)response)[0] is registration state 0-6,
1804  *              0 - Not registered, MT is not currently searching
1805  *                  a new operator to register
1806  *              1 - Registered, home network
1807  *              2 - Not registered, but MT is currently searching
1808  *                  a new operator to register
1809  *              3 - Registration denied
1810  *              4 - Unknown
1811  *              5 - Registered, roaming
1812  *             10 - Same as 0, but indicates that emergency calls
1813  *                  are enabled.
1814  *             12 - Same as 2, but indicates that emergency calls
1815  *                  are enabled.
1816  *             13 - Same as 3, but indicates that emergency calls
1817  *                  are enabled.
1818  *             14 - Same as 4, but indicates that emergency calls
1819  *                  are enabled.
1820  *
1821  * ((const char **)response)[1] is LAC if registered on a GSM/WCDMA system or
1822  *                              NULL if not.Valid LAC are 0x0000 - 0xffff
1823  * ((const char **)response)[2] is CID if registered on a * GSM/WCDMA or
1824  *                              NULL if not.
1825  *                                 Valid CID are 0x00000000 - 0xffffffff
1826  *                                    In GSM, CID is Cell ID (see TS 27.007)
1827  *                                            in 16 bits
1828  *                                    In UMTS, CID is UMTS Cell Identity
1829  *                                             (see TS 25.331) in 28 bits
1830  * ((const char **)response)[3] indicates the available voice radio technology,
1831  *                              valid values as defined by RIL_RadioTechnology.
1832  * ((const char **)response)[4] is Base Station ID if registered on a CDMA
1833  *                              system or NULL if not.  Base Station ID in
1834  *                              decimal format
1835  * ((const char **)response)[5] is Base Station latitude if registered on a
1836  *                              CDMA system or NULL if not. Base Station
1837  *                              latitude is a decimal number as specified in
1838  *                              3GPP2 C.S0005-A v6.0. It is represented in
1839  *                              units of 0.25 seconds and ranges from -1296000
1840  *                              to 1296000, both values inclusive (corresponding
1841  *                              to a range of -90 to +90 degrees).
1842  * ((const char **)response)[6] is Base Station longitude if registered on a
1843  *                              CDMA system or NULL if not. Base Station
1844  *                              longitude is a decimal number as specified in
1845  *                              3GPP2 C.S0005-A v6.0. It is represented in
1846  *                              units of 0.25 seconds and ranges from -2592000
1847  *                              to 2592000, both values inclusive (corresponding
1848  *                              to a range of -180 to +180 degrees).
1849  * ((const char **)response)[7] is concurrent services support indicator if
1850  *                              registered on a CDMA system 0-1.
1851  *                                   0 - Concurrent services not supported,
1852  *                                   1 - Concurrent services supported
1853  * ((const char **)response)[8] is System ID if registered on a CDMA system or
1854  *                              NULL if not. Valid System ID are 0 - 32767
1855  * ((const char **)response)[9] is Network ID if registered on a CDMA system or
1856  *                              NULL if not. Valid System ID are 0 - 65535
1857  * ((const char **)response)[10] is the TSB-58 Roaming Indicator if registered
1858  *                               on a CDMA or EVDO system or NULL if not. Valid values
1859  *                               are 0-255.
1860  * ((const char **)response)[11] indicates whether the current system is in the
1861  *                               PRL if registered on a CDMA or EVDO system or NULL if
1862  *                               not. 0=not in the PRL, 1=in the PRL
1863  * ((const char **)response)[12] is the default Roaming Indicator from the PRL,
1864  *                               if registered on a CDMA or EVDO system or NULL if not.
1865  *                               Valid values are 0-255.
1866  * ((const char **)response)[13] if registration state is 3 (Registration
1867  *                               denied) this is an enumerated reason why
1868  *                               registration was denied.  See 3GPP TS 24.008,
1869  *                               10.5.3.6 and Annex G.
1870  *                                 0 - General
1871  *                                 1 - Authentication Failure
1872  *                                 2 - IMSI unknown in HLR
1873  *                                 3 - Illegal MS
1874  *                                 4 - Illegal ME
1875  *                                 5 - PLMN not allowed
1876  *                                 6 - Location area not allowed
1877  *                                 7 - Roaming not allowed
1878  *                                 8 - No Suitable Cells in this Location Area
1879  *                                 9 - Network failure
1880  *                                10 - Persistent location update reject
1881  *                                11 - PLMN not allowed
1882  *                                12 - Location area not allowed
1883  *                                13 - Roaming not allowed in this Location Area
1884  *                                15 - No Suitable Cells in this Location Area
1885  *                                17 - Network Failure
1886  *                                20 - MAC Failure
1887  *                                21 - Sync Failure
1888  *                                22 - Congestion
1889  *                                23 - GSM Authentication unacceptable
1890  *                                25 - Not Authorized for this CSG
1891  *                                32 - Service option not supported
1892  *                                33 - Requested service option not subscribed
1893  *                                34 - Service option temporarily out of order
1894  *                                38 - Call cannot be identified
1895  *                                48-63 - Retry upon entry into a new cell
1896  *                                95 - Semantically incorrect message
1897  *                                96 - Invalid mandatory information
1898  *                                97 - Message type non-existent or not implemented
1899  *                                98 - Message not compatible with protocol state
1900  *                                99 - Information element non-existent or not implemented
1901  *                               100 - Conditional IE error
1902  *                               101 - Message not compatible with protocol state
1903  *                               111 - Protocol error, unspecified
1904  * ((const char **)response)[14] is the Primary Scrambling Code of the current
1905  *                               cell as described in TS 25.331, in hexadecimal
1906  *                               format, or NULL if unknown or not registered
1907  *                               to a UMTS network.
1908  *
1909  * Please note that registration state 4 ("unknown") is treated
1910  * as "out of service" in the Android telephony system
1911  *
1912  * Registration state 3 can be returned if Location Update Reject
1913  * (with cause 17 - Network Failure) is received repeatedly from the network,
1914  * to facilitate "managed roaming"
1915  *
1916  * Valid errors:
1917  *  SUCCESS
1918  *  RADIO_NOT_AVAILABLE
1919  *  GENERIC_FAILURE
1920  */
1921 #define RIL_REQUEST_VOICE_REGISTRATION_STATE 20
1922
1923 /**
1924  * RIL_REQUEST_DATA_REGISTRATION_STATE
1925  *
1926  * Request current DATA registration state
1927  *
1928  * "data" is NULL
1929  * "response" is a "char **"
1930  * ((const char **)response)[0] is registration state 0-5 from TS 27.007 10.1.20 AT+CGREG
1931  * ((const char **)response)[1] is LAC if registered or NULL if not
1932  * ((const char **)response)[2] is CID if registered or NULL if not
1933  * ((const char **)response)[3] indicates the available data radio technology,
1934  *                              valid values as defined by RIL_RadioTechnology.
1935  * ((const char **)response)[4] if registration state is 3 (Registration
1936  *                               denied) this is an enumerated reason why
1937  *                               registration was denied.  See 3GPP TS 24.008,
1938  *                               Annex G.6 "Additonal cause codes for GMM".
1939  *      7 == GPRS services not allowed
1940  *      8 == GPRS services and non-GPRS services not allowed
1941  *      9 == MS identity cannot be derived by the network
1942  *      10 == Implicitly detached
1943  *      14 == GPRS services not allowed in this PLMN
1944  *      16 == MSC temporarily not reachable
1945  *      40 == No PDP context activated
1946  * ((const char **)response)[5] The maximum number of simultaneous Data Calls that can be
1947  *                              established using RIL_REQUEST_SETUP_DATA_CALL.
1948  *
1949  * The values at offsets 6..10 are optional LTE location information in decimal.
1950  * If a value is unknown that value may be NULL. If all values are NULL,
1951  * none need to be present.
1952  *  ((const char **)response)[6] is TAC, a 16-bit Tracking Area Code.
1953  *  ((const char **)response)[7] is CID, a 0-503 Physical Cell Identifier.
1954  *  ((const char **)response)[8] is ECI, a 28-bit E-UTRAN Cell Identifier.
1955  *  ((const char **)response)[9] is CSGID, a 27-bit Closed Subscriber Group Identity.
1956  *  ((const char **)response)[10] is TADV, a 6-bit timing advance value.
1957  *
1958  * LAC and CID are in hexadecimal format.
1959  * valid LAC are 0x0000 - 0xffff
1960  * valid CID are 0x00000000 - 0x0fffffff
1961  *
1962  * Please note that registration state 4 ("unknown") is treated
1963  * as "out of service" in the Android telephony system
1964  *
1965  * Valid errors:
1966  *  SUCCESS
1967  *  RADIO_NOT_AVAILABLE
1968  *  GENERIC_FAILURE
1969  */
1970 #define RIL_REQUEST_DATA_REGISTRATION_STATE 21
1971
1972 /**
1973  * RIL_REQUEST_OPERATOR
1974  *
1975  * Request current operator ONS or EONS
1976  *
1977  * "data" is NULL
1978  * "response" is a "const char **"
1979  * ((const char **)response)[0] is long alpha ONS or EONS
1980  *                                  or NULL if unregistered
1981  *
1982  * ((const char **)response)[1] is short alpha ONS or EONS
1983  *                                  or NULL if unregistered
1984  * ((const char **)response)[2] is 5 or 6 digit numeric code (MCC + MNC)
1985  *                                  or NULL if unregistered
1986  *
1987  * Valid errors:
1988  *  SUCCESS
1989  *  RADIO_NOT_AVAILABLE
1990  *  GENERIC_FAILURE
1991  */
1992 #define RIL_REQUEST_OPERATOR 22
1993
1994 /**
1995  * RIL_REQUEST_RADIO_POWER
1996  *
1997  * Toggle radio on and off (for "airplane" mode)
1998  * If the radio is is turned off/on the radio modem subsystem
1999  * is expected return to an initialized state. For instance,
2000  * any voice and data calls will be terminated and all associated
2001  * lists emptied.
2002  *
2003  * "data" is int *
2004  * ((int *)data)[0] is > 0 for "Radio On"
2005  * ((int *)data)[0] is == 0 for "Radio Off"
2006  *
2007  * "response" is NULL
2008  *
2009  * Turn radio on if "on" > 0
2010  * Turn radio off if "on" == 0
2011  *
2012  * Valid errors:
2013  *  SUCCESS
2014  *  RADIO_NOT_AVAILABLE
2015  *  GENERIC_FAILURE
2016  */
2017 #define RIL_REQUEST_RADIO_POWER 23
2018
2019 /**
2020  * RIL_REQUEST_DTMF
2021  *
2022  * Send a DTMF tone
2023  *
2024  * If the implementation is currently playing a tone requested via
2025  * RIL_REQUEST_DTMF_START, that tone should be cancelled and the new tone
2026  * should be played instead
2027  *
2028  * "data" is a char * containing a single character with one of 12 values: 0-9,*,#
2029  * "response" is NULL
2030  *
2031  * FIXME should this block/mute microphone?
2032  * How does this interact with local DTMF feedback?
2033  *
2034  * Valid errors:
2035  *  SUCCESS
2036  *  RADIO_NOT_AVAILABLE
2037  *  GENERIC_FAILURE
2038  *
2039  * See also: RIL_REQUEST_DTMF_STOP, RIL_REQUEST_DTMF_START
2040  *
2041  */
2042 #define RIL_REQUEST_DTMF 24
2043
2044 /**
2045  * RIL_REQUEST_SEND_SMS
2046  *
2047  * Send an SMS message
2048  *
2049  * "data" is const char **
2050  * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
2051  *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
2052  * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
2053  *      less the SMSC address
2054  *      TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
2055  *
2056  * "response" is a const RIL_SMS_Response *
2057  *
2058  * Based on the return error, caller decides to resend if sending sms
2059  * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
2060  * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
2061  *
2062  * Valid errors:
2063  *  SUCCESS
2064  *  RADIO_NOT_AVAILABLE
2065  *  SMS_SEND_FAIL_RETRY
2066  *  FDN_CHECK_FAILURE
2067  *  GENERIC_FAILURE
2068  *
2069  * FIXME how do we specify TP-Message-Reference if we need to resend?
2070  */
2071 #define RIL_REQUEST_SEND_SMS 25
2072
2073
2074 /**
2075  * RIL_REQUEST_SEND_SMS_EXPECT_MORE
2076  *
2077  * Send an SMS message. Identical to RIL_REQUEST_SEND_SMS,
2078  * except that more messages are expected to be sent soon. If possible,
2079  * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command)
2080  *
2081  * "data" is const char **
2082  * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed
2083  *      by a length byte (as expected by TS 27.005) or NULL for default SMSC
2084  * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string
2085  *      less the SMSC address
2086  *      TP-Layer-Length is be "strlen(((const char **)data)[1])/2"
2087  *
2088  * "response" is a const RIL_SMS_Response *
2089  *
2090  * Based on the return error, caller decides to resend if sending sms
2091  * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332)
2092  * and GENERIC_FAILURE means no retry (i.e. error cause is 500)
2093  *
2094  * Valid errors:
2095  *  SUCCESS
2096  *  RADIO_NOT_AVAILABLE
2097  *  SMS_SEND_FAIL_RETRY
2098  *  GENERIC_FAILURE
2099  *
2100  */
2101 #define RIL_REQUEST_SEND_SMS_EXPECT_MORE 26
2102
2103
2104 /**
2105  * RIL_REQUEST_SETUP_DATA_CALL
2106  *
2107  * Setup a packet data connection. If RIL_Data_Call_Response_v6.status
2108  * return success it is added to the list of data calls and a
2109  * RIL_UNSOL_DATA_CALL_LIST_CHANGED is sent. The call remains in the
2110  * list until RIL_REQUEST_DEACTIVATE_DATA_CALL is issued or the
2111  * radio is powered off/on. This list is returned by RIL_REQUEST_DATA_CALL_LIST
2112  * and RIL_UNSOL_DATA_CALL_LIST_CHANGED.
2113  *
2114  * The RIL is expected to:
2115  *  - Create one data call context.
2116  *  - Create and configure a dedicated interface for the context
2117  *  - The interface must be point to point.
2118  *  - The interface is configured with one or more addresses and
2119  *    is capable of sending and receiving packets. The prefix length
2120  *    of the addresses must be /32 for IPv4 and /128 for IPv6.
2121  *  - Must NOT change the linux routing table.
2122  *  - Support up to RIL_REQUEST_DATA_REGISTRATION_STATE response[5]
2123  *    number of simultaneous data call contexts.
2124  *
2125  * "data" is a const char **
2126  * ((const char **)data)[0] Radio technology to use: 0-CDMA, 1-GSM/UMTS, 2...
2127  *                          for values above 2 this is RIL_RadioTechnology + 2.
2128  * ((const char **)data)[1] is a RIL_DataProfile (support is optional)
2129  * ((const char **)data)[2] is the APN to connect to if radio technology is GSM/UMTS. This APN will
2130  *                          override the one in the profile. NULL indicates no APN overrride.
2131  * ((const char **)data)[3] is the username for APN, or NULL
2132  * ((const char **)data)[4] is the password for APN, or NULL
2133  * ((const char **)data)[5] is the PAP / CHAP auth type. Values:
2134  *                          0 => PAP and CHAP is never performed.
2135  *                          1 => PAP may be performed; CHAP is never performed.
2136  *                          2 => CHAP may be performed; PAP is never performed.
2137  *                          3 => PAP / CHAP may be performed - baseband dependent.
2138  * ((const char **)data)[6] is the connection type to request must be one of the
2139  *                          PDP_type values in TS 27.007 section 10.1.1.
2140  *                          For example, "IP", "IPV6", "IPV4V6", or "PPP".
2141  * ((const char **)data)[7] Optional connection property parameters, format to be defined.
2142  *
2143  * "response" is a RIL_Data_Call_Response_v11
2144  *
2145  * FIXME may need way to configure QoS settings
2146  *
2147  * Valid errors:
2148  *  SUCCESS should be returned on both success and failure of setup with
2149  *  the RIL_Data_Call_Response_v6.status containing the actual status.
2150  *  For all other errors the RIL_Data_Call_Resonse_v6 is ignored.
2151  *
2152  *  Other errors could include:
2153  *    RADIO_NOT_AVAILABLE, GENERIC_FAILURE, OP_NOT_ALLOWED_BEFORE_REG_TO_NW,
2154  *    OP_NOT_ALLOWED_DURING_VOICE_CALL and REQUEST_NOT_SUPPORTED.
2155  *
2156  * See also: RIL_REQUEST_DEACTIVATE_DATA_CALL
2157  */
2158 #define RIL_REQUEST_SETUP_DATA_CALL 27
2159
2160
2161 /**
2162  * RIL_REQUEST_SIM_IO
2163  *
2164  * Request SIM I/O operation.
2165  * This is similar to the TS 27.007 "restricted SIM" operation
2166  * where it assumes all of the EF selection will be done by the
2167  * callee.
2168  *
2169  * "data" is a const RIL_SIM_IO_v6 *
2170  * Please note that RIL_SIM_IO has a "PIN2" field which may be NULL,
2171  * or may specify a PIN2 for operations that require a PIN2 (eg
2172  * updating FDN records)
2173  *
2174  * "response" is a const RIL_SIM_IO_Response *
2175  *
2176  * Arguments and responses that are unused for certain
2177  * values of "command" should be ignored or set to NULL
2178  *
2179  * Valid errors:
2180  *  SUCCESS
2181  *  RADIO_NOT_AVAILABLE
2182  *  GENERIC_FAILURE
2183  *  SIM_PIN2
2184  *  SIM_PUK2
2185  */
2186 #define RIL_REQUEST_SIM_IO 28
2187
2188 /**
2189  * RIL_REQUEST_SEND_USSD
2190  *
2191  * Send a USSD message
2192  *
2193  * If a USSD session already exists, the message should be sent in the
2194  * context of that session. Otherwise, a new session should be created.
2195  *
2196  * The network reply should be reported via RIL_UNSOL_ON_USSD
2197  *
2198  * Only one USSD session may exist at a time, and the session is assumed
2199  * to exist until:
2200  *   a) The android system invokes RIL_REQUEST_CANCEL_USSD
2201  *   b) The implementation sends a RIL_UNSOL_ON_USSD with a type code
2202  *      of "0" (USSD-Notify/no further action) or "2" (session terminated)
2203  *
2204  * "data" is a const char * containing the USSD request in UTF-8 format
2205  * "response" is NULL
2206  *
2207  * Valid errors:
2208  *  SUCCESS
2209  *  RADIO_NOT_AVAILABLE
2210  *  FDN_CHECK_FAILURE
2211  *  USSD_MODIFIED_TO_DIAL
2212  *  USSD_MODIFIED_TO_SS
2213  *  USSD_MODIFIED_TO_USSD
2214  *  GENERIC_FAILURE
2215  *
2216  * See also: RIL_REQUEST_CANCEL_USSD, RIL_UNSOL_ON_USSD
2217  */
2218
2219 #define RIL_REQUEST_SEND_USSD 29
2220
2221 /**
2222  * RIL_REQUEST_CANCEL_USSD
2223  *
2224  * Cancel the current USSD session if one exists
2225  *
2226  * "data" is null
2227  * "response" is NULL
2228  *
2229  * Valid errors:
2230  *  SUCCESS
2231  *  RADIO_NOT_AVAILABLE
2232  *  GENERIC_FAILURE
2233  */
2234
2235 #define RIL_REQUEST_CANCEL_USSD 30
2236
2237 /**
2238  * RIL_REQUEST_GET_CLIR
2239  *
2240  * Gets current CLIR status
2241  * "data" is NULL
2242  * "response" is int *
2243  * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
2244  * ((int *)data)[1] is "m" parameter from TS 27.007 7.7
2245  *
2246  * Valid errors:
2247  *  SUCCESS
2248  *  RADIO_NOT_AVAILABLE
2249  *  SS_MODIFIED_TO_DIAL
2250  *  SS_MODIFIED_TO_USSD
2251  *  SS_MODIFIED_TO_SS
2252  *  GENERIC_FAILURE
2253  */
2254 #define RIL_REQUEST_GET_CLIR 31
2255
2256 /**
2257  * RIL_REQUEST_SET_CLIR
2258  *
2259  * "data" is int *
2260  * ((int *)data)[0] is "n" parameter from TS 27.007 7.7
2261  *
2262  * "response" is NULL
2263  *
2264  * Valid errors:
2265  *  SUCCESS
2266  *  RADIO_NOT_AVAILABLE
2267  *  SS_MODIFIED_TO_DIAL
2268  *  SS_MODIFIED_TO_USSD
2269  *  SS_MODIFIED_TO_SS
2270  *  GENERIC_FAILURE
2271  */
2272 #define RIL_REQUEST_SET_CLIR 32
2273
2274 /**
2275  * RIL_REQUEST_QUERY_CALL_FORWARD_STATUS
2276  *
2277  * "data" is const RIL_CallForwardInfo *
2278  *
2279  * "response" is const RIL_CallForwardInfo **
2280  * "response" points to an array of RIL_CallForwardInfo *'s, one for
2281  * each distinct registered phone number.
2282  *
2283  * For example, if data is forwarded to +18005551212 and voice is forwarded
2284  * to +18005559999, then two separate RIL_CallForwardInfo's should be returned
2285  *
2286  * If, however, both data and voice are forwarded to +18005551212, then
2287  * a single RIL_CallForwardInfo can be returned with the service class
2288  * set to "data + voice = 3")
2289  *
2290  * Valid errors:
2291  *  SUCCESS
2292  *  RADIO_NOT_AVAILABLE
2293  *  SS_MODIFIED_TO_DIAL
2294  *  SS_MODIFIED_TO_USSD
2295  *  SS_MODIFIED_TO_SS
2296  *  GENERIC_FAILURE
2297  */
2298 #define RIL_REQUEST_QUERY_CALL_FORWARD_STATUS 33
2299
2300
2301 /**
2302  * RIL_REQUEST_SET_CALL_FORWARD
2303  *
2304  * Configure call forward rule
2305  *
2306  * "data" is const RIL_CallForwardInfo *
2307  * "response" is NULL
2308  *
2309  * Valid errors:
2310  *  SUCCESS
2311  *  RADIO_NOT_AVAILABLE
2312  *  SS_MODIFIED_TO_DIAL
2313  *  SS_MODIFIED_TO_USSD
2314  *  SS_MODIFIED_TO_SS
2315  *  GENERIC_FAILURE
2316  */
2317 #define RIL_REQUEST_SET_CALL_FORWARD 34
2318
2319
2320 /**
2321  * RIL_REQUEST_QUERY_CALL_WAITING
2322  *
2323  * Query current call waiting state
2324  *
2325  * "data" is const int *
2326  * ((const int *)data)[0] is the TS 27.007 service class to query.
2327  * "response" is a const int *
2328  * ((const int *)response)[0] is 0 for "disabled" and 1 for "enabled"
2329  *
2330  * If ((const int *)response)[0] is = 1, then ((const int *)response)[1]
2331  * must follow, with the TS 27.007 service class bit vector of services
2332  * for which call waiting is enabled.
2333  *
2334  * For example, if ((const int *)response)[0]  is 1 and
2335  * ((const int *)response)[1] is 3, then call waiting is enabled for data
2336  * and voice and disabled for everything else
2337  *
2338  * Valid errors:
2339  *  SUCCESS
2340  *  RADIO_NOT_AVAILABLE
2341  *  SS_MODIFIED_TO_DIAL
2342  *  SS_MODIFIED_TO_USSD
2343  *  SS_MODIFIED_TO_SS
2344  *  GENERIC_FAILURE
2345  */
2346 #define RIL_REQUEST_QUERY_CALL_WAITING 35
2347
2348
2349 /**
2350  * RIL_REQUEST_SET_CALL_WAITING
2351  *
2352  * Configure current call waiting state
2353  *
2354  * "data" is const int *
2355  * ((const int *)data)[0] is 0 for "disabled" and 1 for "enabled"
2356  * ((const int *)data)[1] is the TS 27.007 service class bit vector of
2357  *                           services to modify
2358  * "response" is NULL
2359  *
2360  * Valid errors:
2361  *  SUCCESS
2362  *  RADIO_NOT_AVAILABLE
2363  *  SS_MODIFIED_TO_DIAL
2364  *  SS_MODIFIED_TO_USSD
2365  *  SS_MODIFIED_TO_SS
2366  *  GENERIC_FAILURE
2367  */
2368 #define RIL_REQUEST_SET_CALL_WAITING 36
2369
2370 /**
2371  * RIL_REQUEST_SMS_ACKNOWLEDGE
2372  *
2373  * Acknowledge successful or failed receipt of SMS previously indicated
2374  * via RIL_UNSOL_RESPONSE_NEW_SMS
2375  *
2376  * "data" is int *
2377  * ((int *)data)[0] is 1 on successful receipt
2378  *                  (basically, AT+CNMA=1 from TS 27.005
2379  *                  is 0 on failed receipt
2380  *                  (basically, AT+CNMA=2 from TS 27.005)
2381  * ((int *)data)[1] if data[0] is 0, this contains the failure cause as defined
2382  *                  in TS 23.040, 9.2.3.22. Currently only 0xD3 (memory
2383  *                  capacity exceeded) and 0xFF (unspecified error) are
2384  *                  reported.
2385  *
2386  * "response" is NULL
2387  *
2388  * FIXME would like request that specified RP-ACK/RP-ERROR PDU
2389  *
2390  * Valid errors:
2391  *  SUCCESS
2392  *  RADIO_NOT_AVAILABLE
2393  *  GENERIC_FAILURE
2394  */
2395 #define RIL_REQUEST_SMS_ACKNOWLEDGE  37
2396
2397 /**
2398  * RIL_REQUEST_GET_IMEI - DEPRECATED
2399  *
2400  * Get the device IMEI, including check digit
2401  *
2402  * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY
2403  * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
2404  *
2405  * "data" is NULL
2406  * "response" is a const char * containing the IMEI
2407  *
2408  * Valid errors:
2409  *  SUCCESS
2410  *  RADIO_NOT_AVAILABLE (radio resetting)
2411  *  GENERIC_FAILURE
2412  */
2413
2414 #define RIL_REQUEST_GET_IMEI 38
2415
2416 /**
2417  * RIL_REQUEST_GET_IMEISV - DEPRECATED
2418  *
2419  * Get the device IMEISV, which should be two decimal digits
2420  *
2421  * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY
2422  * Valid when RadioState is not RADIO_STATE_UNAVAILABLE
2423  *
2424  * "data" is NULL
2425  * "response" is a const char * containing the IMEISV
2426  *
2427  * Valid errors:
2428  *  SUCCESS
2429  *  RADIO_NOT_AVAILABLE (radio resetting)
2430  *  GENERIC_FAILURE
2431  */
2432
2433 #define RIL_REQUEST_GET_IMEISV 39
2434
2435
2436 /**
2437  * RIL_REQUEST_ANSWER
2438  *
2439  * Answer incoming call
2440  *
2441  * Will not be called for WAITING calls.
2442  * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE will be used in this case
2443  * instead
2444  *
2445  * "data" is NULL
2446  * "response" is NULL
2447  *
2448  * Valid errors:
2449  *  SUCCESS
2450  *  RADIO_NOT_AVAILABLE (radio resetting)
2451  *  GENERIC_FAILURE
2452  */
2453
2454 #define RIL_REQUEST_ANSWER 40
2455
2456 /**
2457  * RIL_REQUEST_DEACTIVATE_DATA_CALL
2458  *
2459  * Deactivate packet data connection and remove from the
2460  * data call list if SUCCESS is returned. Any other return
2461  * values should also try to remove the call from the list,
2462  * but that may not be possible. In any event a
2463  * RIL_REQUEST_RADIO_POWER off/on must clear the list. An
2464  * RIL_UNSOL_DATA_CALL_LIST_CHANGED is not expected to be
2465  * issued because of an RIL_REQUEST_DEACTIVATE_DATA_CALL.
2466  *
2467  * "data" is const char **
2468  * ((char**)data)[0] indicating CID
2469  * ((char**)data)[1] indicating Disconnect Reason
2470  *                   0 => No specific reason specified
2471  *                   1 => Radio shutdown requested
2472  *
2473  * "response" is NULL
2474  *
2475  * Valid errors:
2476  *  SUCCESS
2477  *  RADIO_NOT_AVAILABLE
2478  *  GENERIC_FAILURE
2479  *
2480  * See also: RIL_REQUEST_SETUP_DATA_CALL
2481  */
2482 #define RIL_REQUEST_DEACTIVATE_DATA_CALL 41
2483
2484 /**
2485  * RIL_REQUEST_QUERY_FACILITY_LOCK
2486  *
2487  * Query the status of a facility lock state
2488  *
2489  * "data" is const char **
2490  * ((const char **)data)[0] is the facility string code from TS 27.007 7.4
2491  *                      (eg "AO" for BAOC, "SC" for SIM lock)
2492  * ((const char **)data)[1] is the password, or "" if not required
2493  * ((const char **)data)[2] is the TS 27.007 service class bit vector of
2494  *                           services to query
2495  * ((const char **)data)[3] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
2496  *                            This is only applicable in the case of Fixed Dialing Numbers
2497  *                            (FDN) requests.
2498  *
2499  * "response" is an int *
2500  * ((const int *)response) 0 is the TS 27.007 service class bit vector of
2501  *                           services for which the specified barring facility
2502  *                           is active. "0" means "disabled for all"
2503  *
2504  *
2505  * Valid errors:
2506  *  SUCCESS
2507  *  RADIO_NOT_AVAILABLE
2508  *  SS_MODIFIED_TO_DIAL
2509  *  SS_MODIFIED_TO_USSD
2510  *  SS_MODIFIED_TO_SS
2511  *  GENERIC_FAILURE
2512  *
2513  */
2514 #define RIL_REQUEST_QUERY_FACILITY_LOCK 42
2515
2516 /**
2517  * RIL_REQUEST_SET_FACILITY_LOCK
2518  *
2519  * Enable/disable one facility lock
2520  *
2521  * "data" is const char **
2522  *
2523  * ((const char **)data)[0] = facility string code from TS 27.007 7.4
2524  * (eg "AO" for BAOC)
2525  * ((const char **)data)[1] = "0" for "unlock" and "1" for "lock"
2526  * ((const char **)data)[2] = password
2527  * ((const char **)data)[3] = string representation of decimal TS 27.007
2528  *                            service class bit vector. Eg, the string
2529  *                            "1" means "set this facility for voice services"
2530  * ((const char **)data)[4] = AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value.
2531  *                            This is only applicable in the case of Fixed Dialing Numbers
2532  *                            (FDN) requests.
2533  *
2534  * "response" is int *
2535  * ((int *)response)[0] is the number of retries remaining, or -1 if unknown
2536  *
2537  * Valid errors:
2538  *  SUCCESS
2539  *  RADIO_NOT_AVAILABLE
2540  *  SS_MODIFIED_TO_DIAL
2541  *  SS_MODIFIED_TO_USSD
2542  *  SS_MODIFIED_TO_SS
2543  *  GENERIC_FAILURE
2544  *
2545  */
2546 #define RIL_REQUEST_SET_FACILITY_LOCK 43
2547
2548 /**
2549  * RIL_REQUEST_CHANGE_BARRING_PASSWORD
2550  *
2551  * Change call barring facility password
2552  *
2553  * "data" is const char **
2554  *
2555  * ((const char **)data)[0] = facility string code from TS 27.007 7.4
2556  * (eg "AO" for BAOC)
2557  * ((const char **)data)[1] = old password
2558  * ((const char **)data)[2] = new password
2559  *
2560  * "response" is NULL
2561  *
2562  * Valid errors:
2563  *  SUCCESS
2564  *  RADIO_NOT_AVAILABLE
2565  *  SS_MODIFIED_TO_DIAL
2566  *  SS_MODIFIED_TO_USSD
2567  *  SS_MODIFIED_TO_SS
2568  *  GENERIC_FAILURE
2569  *
2570  */
2571 #define RIL_REQUEST_CHANGE_BARRING_PASSWORD 44
2572
2573 /**
2574  * RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE
2575  *
2576  * Query current network selectin mode
2577  *
2578  * "data" is NULL
2579  *
2580  * "response" is int *
2581  * ((const int *)response)[0] is
2582  *     0 for automatic selection
2583  *     1 for manual selection
2584  *
2585  * Valid errors:
2586  *  SUCCESS
2587  *  RADIO_NOT_AVAILABLE
2588  *  GENERIC_FAILURE
2589  *
2590  */
2591 #define RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE 45
2592
2593 /**
2594  * RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC
2595  *
2596  * Specify that the network should be selected automatically
2597  *
2598  * "data" is NULL
2599  * "response" is NULL
2600  *
2601  * This request must not respond until the new operator is selected
2602  * and registered
2603  *
2604  * Valid errors:
2605  *  SUCCESS
2606  *  RADIO_NOT_AVAILABLE
2607  *  ILLEGAL_SIM_OR_ME
2608  *  GENERIC_FAILURE
2609  *
2610  * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and
2611  *       no retries needed, such as illegal SIM or ME.
2612  *       Returns GENERIC_FAILURE for all other causes that might be
2613  *       fixed by retries.
2614  *
2615  */
2616 #define RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC 46
2617
2618 /**
2619  * RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL
2620  *
2621  * Manually select a specified network.
2622  *
2623  * "data" is const char * specifying MCCMNC of network to select (eg "310170")
2624  * "response" is NULL
2625  *
2626  * This request must not respond until the new operator is selected
2627  * and registered
2628  *
2629  * Valid errors:
2630  *  SUCCESS
2631  *  RADIO_NOT_AVAILABLE
2632  *  ILLEGAL_SIM_OR_ME
2633  *  GENERIC_FAILURE
2634  *
2635  * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and
2636  *       no retries needed, such as illegal SIM or ME.
2637  *       Returns GENERIC_FAILURE for all other causes that might be
2638  *       fixed by retries.
2639  *
2640  */
2641 #define RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL 47
2642
2643 /**
2644  * RIL_REQUEST_QUERY_AVAILABLE_NETWORKS
2645  *
2646  * Scans for available networks
2647  *
2648  * "data" is NULL
2649  * "response" is const char ** that should be an array of n*4 strings, where
2650  *    n is the number of available networks
2651  * For each available network:
2652  *
2653  * ((const char **)response)[n+0] is long alpha ONS or EONS
2654  * ((const char **)response)[n+1] is short alpha ONS or EONS
2655  * ((const char **)response)[n+2] is 5 or 6 digit numeric code (MCC + MNC)
2656  * ((const char **)response)[n+3] is a string value of the status:
2657  *           "unknown"
2658  *           "available"
2659  *           "current"
2660  *           "forbidden"
2661  *
2662  * This request must not respond until the new operator is selected
2663  * and registered
2664  *
2665  * Valid errors:
2666  *  SUCCESS
2667  *  RADIO_NOT_AVAILABLE
2668  *  GENERIC_FAILURE
2669  *
2670  */
2671 #define RIL_REQUEST_QUERY_AVAILABLE_NETWORKS 48
2672
2673 /**
2674  * RIL_REQUEST_DTMF_START
2675  *
2676  * Start playing a DTMF tone. Continue playing DTMF tone until
2677  * RIL_REQUEST_DTMF_STOP is received
2678  *
2679  * If a RIL_REQUEST_DTMF_START is received while a tone is currently playing,
2680  * it should cancel the previous tone and play the new one.
2681  *
2682  * "data" is a char *
2683  * ((char *)data)[0] is a single character with one of 12 values: 0-9,*,#
2684  * "response" is NULL
2685  *
2686  * Valid errors:
2687  *  SUCCESS
2688  *  RADIO_NOT_AVAILABLE
2689  *  GENERIC_FAILURE
2690  *
2691  * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_STOP
2692  */
2693 #define RIL_REQUEST_DTMF_START 49
2694
2695 /**
2696  * RIL_REQUEST_DTMF_STOP
2697  *
2698  * Stop playing a currently playing DTMF tone.
2699  *
2700  * "data" is NULL
2701  * "response" is NULL
2702  *
2703  * Valid errors:
2704  *  SUCCESS
2705  *  RADIO_NOT_AVAILABLE
2706  *  GENERIC_FAILURE
2707  *
2708  * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_START
2709  */
2710 #define RIL_REQUEST_DTMF_STOP 50
2711
2712 /**
2713  * RIL_REQUEST_BASEBAND_VERSION
2714  *
2715  * Return string value indicating baseband version, eg
2716  * response from AT+CGMR
2717  *
2718  * "data" is NULL
2719  * "response" is const char * containing version string for log reporting
2720  *
2721  * Valid errors:
2722  *  SUCCESS
2723  *  RADIO_NOT_AVAILABLE
2724  *  GENERIC_FAILURE
2725  *
2726  */
2727 #define RIL_REQUEST_BASEBAND_VERSION 51
2728
2729 /**
2730  * RIL_REQUEST_SEPARATE_CONNECTION
2731  *
2732  * Separate a party from a multiparty call placing the multiparty call
2733  * (less the specified party) on hold and leaving the specified party
2734  * as the only other member of the current (active) call
2735  *
2736  * Like AT+CHLD=2x
2737  *
2738  * See TS 22.084 1.3.8.2 (iii)
2739  * TS 22.030 6.5.5 "Entering "2X followed by send"
2740  * TS 27.007 "AT+CHLD=2x"
2741  *
2742  * "data" is an int *
2743  * (int *)data)[0] contains Connection index (value of 'x' in CHLD above) "response" is NULL
2744  *
2745  * "response" is NULL
2746  *
2747  * Valid errors:
2748  *  SUCCESS
2749  *  RADIO_NOT_AVAILABLE (radio resetting)
2750  *  GENERIC_FAILURE
2751  */
2752 #define RIL_REQUEST_SEPARATE_CONNECTION 52
2753
2754
2755 /**
2756  * RIL_REQUEST_SET_MUTE
2757  *
2758  * Turn on or off uplink (microphone) mute.
2759  *
2760  * Will only be sent while voice call is active.
2761  * Will always be reset to "disable mute" when a new voice call is initiated
2762  *
2763  * "data" is an int *
2764  * (int *)data)[0] is 1 for "enable mute" and 0 for "disable mute"
2765  *
2766  * "response" is NULL
2767  *
2768  * Valid errors:
2769  *  SUCCESS
2770  *  RADIO_NOT_AVAILABLE (radio resetting)
2771  *  GENERIC_FAILURE
2772  */
2773
2774 #define RIL_REQUEST_SET_MUTE 53
2775
2776 /**
2777  * RIL_REQUEST_GET_MUTE
2778  *
2779  * Queries the current state of the uplink mute setting
2780  *
2781  * "data" is NULL
2782  * "response" is an int *
2783  * (int *)response)[0] is 1 for "mute enabled" and 0 for "mute disabled"
2784  *
2785  * Valid errors:
2786  *  SUCCESS
2787  *  RADIO_NOT_AVAILABLE (radio resetting)
2788  *  SS_MODIFIED_TO_DIAL
2789  *  SS_MODIFIED_TO_USSD
2790  *  SS_MODIFIED_TO_SS
2791  *  GENERIC_FAILURE
2792  */
2793
2794 #define RIL_REQUEST_GET_MUTE 54
2795
2796 /**
2797  * RIL_REQUEST_QUERY_CLIP
2798  *
2799  * Queries the status of the CLIP supplementary service
2800  *
2801  * (for MMI code "*#30#")
2802  *
2803  * "data" is NULL
2804  * "response" is an int *
2805  * (int *)response)[0] is 1 for "CLIP provisioned"
2806  *                           and 0 for "CLIP not provisioned"
2807  *                           and 2 for "unknown, e.g. no network etc"
2808  *
2809  * Valid errors:
2810  *  SUCCESS
2811  *  RADIO_NOT_AVAILABLE (radio resetting)
2812  *  GENERIC_FAILURE
2813  */
2814
2815 #define RIL_REQUEST_QUERY_CLIP 55
2816
2817 /**
2818  * RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE - Deprecated use the status
2819  * field in RIL_Data_Call_Response_v6.
2820  *
2821  * Requests the failure cause code for the most recently failed PDP
2822  * context or CDMA data connection active
2823  * replaces RIL_REQUEST_LAST_PDP_FAIL_CAUSE
2824  *
2825  * "data" is NULL
2826  *
2827  * "response" is a "int *"
2828  * ((int *)response)[0] is an integer cause code defined in TS 24.008
2829  *   section 6.1.3.1.3 or close approximation
2830  *
2831  * If the implementation does not have access to the exact cause codes,
2832  * then it should return one of the values listed in
2833  * RIL_DataCallFailCause, as the UI layer needs to distinguish these
2834  * cases for error notification
2835  * and potential retries.
2836  *
2837  * Valid errors:
2838  *  SUCCESS
2839  *  RADIO_NOT_AVAILABLE
2840  *  GENERIC_FAILURE
2841  *
2842  * See also: RIL_REQUEST_LAST_CALL_FAIL_CAUSE
2843  *
2844  * Deprecated use the status field in RIL_Data_Call_Response_v6.
2845  */
2846
2847 #define RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE 56
2848
2849 /**
2850  * RIL_REQUEST_DATA_CALL_LIST
2851  *
2852  * Returns the data call list. An entry is added when a
2853  * RIL_REQUEST_SETUP_DATA_CALL is issued and removed on a
2854  * RIL_REQUEST_DEACTIVATE_DATA_CALL. The list is emptied
2855  * when RIL_REQUEST_RADIO_POWER off/on is issued.
2856  *
2857  * "data" is NULL
2858  * "response" is an array of RIL_Data_Call_Response_v6
2859  *
2860  * Valid errors:
2861  *  SUCCESS
2862  *  RADIO_NOT_AVAILABLE (radio resetting)
2863  *  GENERIC_FAILURE
2864  *
2865  * See also: RIL_UNSOL_DATA_CALL_LIST_CHANGED
2866  */
2867
2868 #define RIL_REQUEST_DATA_CALL_LIST 57
2869
2870 /**
2871  * RIL_REQUEST_RESET_RADIO - DEPRECATED
2872  *
2873  * Request a radio reset. The RIL implementation may postpone
2874  * the reset until after this request is responded to if the baseband
2875  * is presently busy.
2876  *
2877  * The request is DEPRECATED, use RIL_REQUEST_RADIO_POWER
2878  *
2879  * "data" is NULL
2880  * "response" is NULL
2881  *
2882  * Valid errors:
2883  *  SUCCESS
2884  *  RADIO_NOT_AVAILABLE (radio resetting)
2885  *  GENERIC_FAILURE
2886  *  REQUEST_NOT_SUPPORTED
2887  */
2888
2889 #define RIL_REQUEST_RESET_RADIO 58
2890
2891 /**
2892  * RIL_REQUEST_OEM_HOOK_RAW
2893  *
2894  * This request reserved for OEM-specific uses. It passes raw byte arrays
2895  * back and forth.
2896  *
2897  * It can be invoked on the Java side from
2898  * com.android.internal.telephony.Phone.invokeOemRilRequestRaw()
2899  *
2900  * "data" is a char * of bytes copied from the byte[] data argument in java
2901  * "response" is a char * of bytes that will returned via the
2902  * caller's "response" Message here:
2903  * (byte[])(((AsyncResult)response.obj).result)
2904  *
2905  * An error response here will result in
2906  * (((AsyncResult)response.obj).result) == null and
2907  * (((AsyncResult)response.obj).exception) being an instance of
2908  * com.android.internal.telephony.gsm.CommandException
2909  *
2910  * Valid errors:
2911  *  All
2912  */
2913
2914 #define RIL_REQUEST_OEM_HOOK_RAW 59
2915
2916 /**
2917  * RIL_REQUEST_OEM_HOOK_STRINGS
2918  *
2919  * This request reserved for OEM-specific uses. It passes strings
2920  * back and forth.
2921  *
2922  * It can be invoked on the Java side from
2923  * com.android.internal.telephony.Phone.invokeOemRilRequestStrings()
2924  *
2925  * "data" is a const char **, representing an array of null-terminated UTF-8
2926  * strings copied from the "String[] strings" argument to
2927  * invokeOemRilRequestStrings()
2928  *
2929  * "response" is a const char **, representing an array of null-terminated UTF-8
2930  * stings that will be returned via the caller's response message here:
2931  *
2932  * (String[])(((AsyncResult)response.obj).result)
2933  *
2934  * An error response here will result in
2935  * (((AsyncResult)response.obj).result) == null and
2936  * (((AsyncResult)response.obj).exception) being an instance of
2937  * com.android.internal.telephony.gsm.CommandException
2938  *
2939  * Valid errors:
2940  *  All
2941  */
2942
2943 #define RIL_REQUEST_OEM_HOOK_STRINGS 60
2944
2945 /**
2946  * RIL_REQUEST_SCREEN_STATE
2947  *
2948  * Indicates the current state of the screen.  When the screen is off, the
2949  * RIL should notify the baseband to suppress certain notifications (eg,
2950  * signal strength and changes in LAC/CID or BID/SID/NID/latitude/longitude)
2951  * in an effort to conserve power.  These notifications should resume when the
2952  * screen is on.
2953  *
2954  * "data" is int *
2955  * ((int *)data)[0] is == 1 for "Screen On"
2956  * ((int *)data)[0] is == 0 for "Screen Off"
2957  *
2958  * "response" is NULL
2959  *
2960  * Valid errors:
2961  *  SUCCESS
2962  *  GENERIC_FAILURE
2963  */
2964 #define RIL_REQUEST_SCREEN_STATE 61
2965
2966
2967 /**
2968  * RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION
2969  *
2970  * Enables/disables supplementary service related notifications
2971  * from the network.
2972  *
2973  * Notifications are reported via RIL_UNSOL_SUPP_SVC_NOTIFICATION.
2974  *
2975  * "data" is int *
2976  * ((int *)data)[0] is == 1 for notifications enabled
2977  * ((int *)data)[0] is == 0 for notifications disabled
2978  *
2979  * "response" is NULL
2980  *
2981  * Valid errors:
2982  *  SUCCESS
2983  *  RADIO_NOT_AVAILABLE
2984  *  GENERIC_FAILURE
2985  *
2986  * See also: RIL_UNSOL_SUPP_SVC_NOTIFICATION.
2987  */
2988 #define RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION 62
2989
2990 /**
2991  * RIL_REQUEST_WRITE_SMS_TO_SIM
2992  *
2993  * Stores a SMS message to SIM memory.
2994  *
2995  * "data" is RIL_SMS_WriteArgs *
2996  *
2997  * "response" is int *
2998  * ((const int *)response)[0] is the record index where the message is stored.
2999  *
3000  * Valid errors:
3001  *  SUCCESS
3002  *  GENERIC_FAILURE
3003  *
3004  */
3005 #define RIL_REQUEST_WRITE_SMS_TO_SIM 63
3006
3007 /**
3008  * RIL_REQUEST_DELETE_SMS_ON_SIM
3009  *
3010  * Deletes a SMS message from SIM memory.
3011  *
3012  * "data" is int  *
3013  * ((int *)data)[0] is the record index of the message to delete.
3014  *
3015  * "response" is NULL
3016  *
3017  * Valid errors:
3018  *  SUCCESS
3019  *  GENERIC_FAILURE
3020  *
3021  */
3022 #define RIL_REQUEST_DELETE_SMS_ON_SIM 64
3023
3024 /**
3025  * RIL_REQUEST_SET_BAND_MODE
3026  *
3027  * Assign a specified band for RF configuration.
3028  *
3029  * "data" is int *
3030  * ((int *)data)[0] is == 0 for "unspecified" (selected by baseband automatically)
3031  * ((int *)data)[0] is == 1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
3032  * ((int *)data)[0] is == 2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
3033  * ((int *)data)[0] is == 3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
3034  * ((int *)data)[0] is == 4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
3035  * ((int *)data)[0] is == 5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
3036  * ((int *)data)[0] is == 6 for "Cellular (800-MHz Band)"
3037  * ((int *)data)[0] is == 7 for "PCS (1900-MHz Band)"
3038  * ((int *)data)[0] is == 8 for "Band Class 3 (JTACS Band)"
3039  * ((int *)data)[0] is == 9 for "Band Class 4 (Korean PCS Band)"
3040  * ((int *)data)[0] is == 10 for "Band Class 5 (450-MHz Band)"
3041  * ((int *)data)[0] is == 11 for "Band Class 6 (2-GMHz IMT2000 Band)"
3042  * ((int *)data)[0] is == 12 for "Band Class 7 (Upper 700-MHz Band)"
3043  * ((int *)data)[0] is == 13 for "Band Class 8 (1800-MHz Band)"
3044  * ((int *)data)[0] is == 14 for "Band Class 9 (900-MHz Band)"
3045  * ((int *)data)[0] is == 15 for "Band Class 10 (Secondary 800-MHz Band)"
3046  * ((int *)data)[0] is == 16 for "Band Class 11 (400-MHz European PAMR Band)"
3047  * ((int *)data)[0] is == 17 for "Band Class 15 (AWS Band)"
3048  * ((int *)data)[0] is == 18 for "Band Class 16 (US 2.5-GHz Band)"
3049  *
3050  * "response" is NULL
3051  *
3052  * Valid errors:
3053  *  SUCCESS
3054  *  RADIO_NOT_AVAILABLE
3055  *  GENERIC_FAILURE
3056  */
3057 #define RIL_REQUEST_SET_BAND_MODE 65
3058
3059 /**
3060  * RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE
3061  *
3062  * Query the list of band mode supported by RF.
3063  *
3064  * "data" is NULL
3065  *
3066  * "response" is int *
3067  * "response" points to an array of int's, the int[0] is the size of array, reset is one for
3068  * each available band mode.
3069  *
3070  *  0 for "unspecified" (selected by baseband automatically)
3071  *  1 for "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
3072  *  2 for "US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
3073  *  3 for "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
3074  *  4 for "AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
3075  *  5 for "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
3076  *  6 for "Cellular (800-MHz Band)"
3077  *  7 for "PCS (1900-MHz Band)"
3078  *  8 for "Band Class 3 (JTACS Band)"
3079  *  9 for "Band Class 4 (Korean PCS Band)"
3080  *  10 for "Band Class 5 (450-MHz Band)"
3081  *  11 for "Band Class 6 (2-GMHz IMT2000 Band)"
3082  *  12 for "Band Class 7 (Upper 700-MHz Band)"
3083  *  13 for "Band Class 8 (1800-MHz Band)"
3084  *  14 for "Band Class 9 (900-MHz Band)"
3085  *  15 for "Band Class 10 (Secondary 800-MHz Band)"
3086  *  16 for "Band Class 11 (400-MHz European PAMR Band)"
3087  *  17 for "Band Class 15 (AWS Band)"
3088  *  18 for "Band Class 16 (US 2.5-GHz Band)"
3089  *
3090  * Valid errors:
3091  *  SUCCESS
3092  *  RADIO_NOT_AVAILABLE
3093  *  GENERIC_FAILURE
3094  *
3095  * See also: RIL_REQUEST_SET_BAND_MODE
3096  */
3097 #define RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE 66
3098
3099 /**
3100  * RIL_REQUEST_STK_GET_PROFILE
3101  *
3102  * Requests the profile of SIM tool kit.
3103  * The profile indicates the SAT/USAT features supported by ME.
3104  * The SAT/USAT features refer to 3GPP TS 11.14 and 3GPP TS 31.111
3105  *
3106  * "data" is NULL
3107  *
3108  * "response" is a const char * containing SAT/USAT profile
3109  * in hexadecimal format string starting with first byte of terminal profile
3110  *
3111  * Valid errors:
3112  *  RIL_E_SUCCESS
3113  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
3114  *  RIL_E_GENERIC_FAILURE
3115  */
3116 #define RIL_REQUEST_STK_GET_PROFILE 67
3117
3118 /**
3119  * RIL_REQUEST_STK_SET_PROFILE
3120  *
3121  * Download the STK terminal profile as part of SIM initialization
3122  * procedure
3123  *
3124  * "data" is a const char * containing SAT/USAT profile
3125  * in hexadecimal format string starting with first byte of terminal profile
3126  *
3127  * "response" is NULL
3128  *
3129  * Valid errors:
3130  *  RIL_E_SUCCESS
3131  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
3132  *  RIL_E_GENERIC_FAILURE
3133  */
3134 #define RIL_REQUEST_STK_SET_PROFILE 68
3135
3136 /**
3137  * RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND
3138  *
3139  * Requests to send a SAT/USAT envelope command to SIM.
3140  * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111
3141  *
3142  * "data" is a const char * containing SAT/USAT command
3143  * in hexadecimal format string starting with command tag
3144  *
3145  * "response" is a const char * containing SAT/USAT response
3146  * in hexadecimal format string starting with first byte of response
3147  * (May be NULL)
3148  *
3149  * Valid errors:
3150  *  RIL_E_SUCCESS
3151  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
3152  *  RIL_E_GENERIC_FAILURE
3153  */
3154 #define RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND 69
3155
3156 /**
3157  * RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE
3158  *
3159  * Requests to send a terminal response to SIM for a received
3160  * proactive command
3161  *
3162  * "data" is a const char * containing SAT/USAT response
3163  * in hexadecimal format string starting with first byte of response data
3164  *
3165  * "response" is NULL
3166  *
3167  * Valid errors:
3168  *  RIL_E_SUCCESS
3169  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
3170  *  RIL_E_GENERIC_FAILURE
3171  */
3172 #define RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE 70
3173
3174 /**
3175  * RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM
3176  *
3177  * When STK application gets RIL_UNSOL_STK_CALL_SETUP, the call actually has
3178  * been initialized by ME already. (We could see the call has been in the 'call
3179  * list') So, STK application needs to accept/reject the call according as user
3180  * operations.
3181  *
3182  * "data" is int *
3183  * ((int *)data)[0] is > 0 for "accept" the call setup
3184  * ((int *)data)[0] is == 0 for "reject" the call setup
3185  *
3186  * "response" is NULL
3187  *
3188  * Valid errors:
3189  *  RIL_E_SUCCESS
3190  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
3191  *  RIL_E_GENERIC_FAILURE
3192  */
3193 #define RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM 71
3194
3195 /**
3196  * RIL_REQUEST_EXPLICIT_CALL_TRANSFER
3197  *
3198  * Connects the two calls and disconnects the subscriber from both calls.
3199  *
3200  * "data" is NULL
3201  * "response" is NULL
3202  *
3203  * Valid errors:
3204  *  SUCCESS
3205  *  RADIO_NOT_AVAILABLE (radio resetting)
3206  *  GENERIC_FAILURE
3207  */
3208 #define RIL_REQUEST_EXPLICIT_CALL_TRANSFER 72
3209
3210 /**
3211  * RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
3212  *
3213  * Requests to set the preferred network type for searching and registering
3214  * (CS/PS domain, RAT, and operation mode)
3215  *
3216  * "data" is int * which is RIL_PreferredNetworkType
3217  *
3218  * "response" is NULL
3219  *
3220  * Valid errors:
3221  *  SUCCESS
3222  *  RADIO_NOT_AVAILABLE (radio resetting)
3223  *  GENERIC_FAILURE
3224  *  MODE_NOT_SUPPORTED
3225  */
3226 #define RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE 73
3227
3228 /**
3229  * RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE
3230  *
3231  * Query the preferred network type (CS/PS domain, RAT, and operation mode)
3232  * for searching and registering
3233  *
3234  * "data" is NULL
3235  *
3236  * "response" is int *
3237  * ((int *)reponse)[0] is == RIL_PreferredNetworkType
3238  *
3239  * Valid errors:
3240  *  SUCCESS
3241  *  RADIO_NOT_AVAILABLE
3242  *  GENERIC_FAILURE
3243  *
3244  * See also: RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE
3245  */
3246 #define RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE 74
3247
3248 /**
3249  * RIL_REQUEST_NEIGHBORING_CELL_IDS
3250  *
3251  * Request neighboring cell id in GSM network
3252  *
3253  * "data" is NULL
3254  * "response" must be a " const RIL_NeighboringCell** "
3255  *
3256  * Valid errors:
3257  *  SUCCESS
3258  *  RADIO_NOT_AVAILABLE
3259  *  GENERIC_FAILURE
3260  */
3261 #define RIL_REQUEST_GET_NEIGHBORING_CELL_IDS 75
3262
3263 /**
3264  * RIL_REQUEST_SET_LOCATION_UPDATES
3265  *
3266  * Enables/disables network state change notifications due to changes in
3267  * LAC and/or CID (for GSM) or BID/SID/NID/latitude/longitude (for CDMA).
3268  * Basically +CREG=2 vs. +CREG=1 (TS 27.007).
3269  *
3270  * Note:  The RIL implementation should default to "updates enabled"
3271  * when the screen is on and "updates disabled" when the screen is off.
3272  *
3273  * "data" is int *
3274  * ((int *)data)[0] is == 1 for updates enabled (+CREG=2)
3275  * ((int *)data)[0] is == 0 for updates disabled (+CREG=1)
3276  *
3277  * "response" is NULL
3278  *
3279  * Valid errors:
3280  *  SUCCESS
3281  *  RADIO_NOT_AVAILABLE
3282  *  GENERIC_FAILURE
3283  *
3284  * See also: RIL_REQUEST_SCREEN_STATE, RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED
3285  */
3286 #define RIL_REQUEST_SET_LOCATION_UPDATES 76
3287
3288 /**
3289  * RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE
3290  *
3291  * Request to set the location where the CDMA subscription shall
3292  * be retrieved
3293  *
3294  * "data" is int *
3295  * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
3296  *
3297  * "response" is NULL
3298  *
3299  * Valid errors:
3300  *  SUCCESS
3301  *  RADIO_NOT_AVAILABLE
3302  *  GENERIC_FAILURE
3303  *  SIM_ABSENT
3304  *  SUBSCRIPTION_NOT_AVAILABLE
3305  *
3306  * See also: RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE
3307  */
3308 #define RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE 77
3309
3310 /**
3311  * RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE
3312  *
3313  * Request to set the roaming preferences in CDMA
3314  *
3315  * "data" is int *
3316  * ((int *)data)[0] is == 0 for Home Networks only, as defined in PRL
3317  * ((int *)data)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL
3318  * ((int *)data)[0] is == 2 for Roaming on Any Network, as defined in the PRL
3319  *
3320  * "response" is NULL
3321  *
3322  * Valid errors:
3323  *  SUCCESS
3324  *  RADIO_NOT_AVAILABLE
3325  *  GENERIC_FAILURE
3326  */
3327 #define RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE 78
3328
3329 /**
3330  * RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE
3331  *
3332  * Request the actual setting of the roaming preferences in CDMA in the modem
3333  *
3334  * "data" is NULL
3335  *
3336  * "response" is int *
3337  * ((int *)response)[0] is == 0 for Home Networks only, as defined in PRL
3338  * ((int *)response)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL
3339  * ((int *)response)[0] is == 2 for Roaming on Any Network, as defined in the PRL
3340  *
3341  * "response" is NULL
3342  *
3343  * Valid errors:
3344  *  SUCCESS
3345  *  RADIO_NOT_AVAILABLE
3346  *  GENERIC_FAILURE
3347  */
3348 #define RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE 79
3349
3350 /**
3351  * RIL_REQUEST_SET_TTY_MODE
3352  *
3353  * Request to set the TTY mode
3354  *
3355  * "data" is int *
3356  * ((int *)data)[0] is == 0 for TTY off
3357  * ((int *)data)[0] is == 1 for TTY Full
3358  * ((int *)data)[0] is == 2 for TTY HCO (hearing carryover)
3359  * ((int *)data)[0] is == 3 for TTY VCO (voice carryover)
3360  *
3361  * "response" is NULL
3362  *
3363  * Valid errors:
3364  *  SUCCESS
3365  *  RADIO_NOT_AVAILABLE
3366  *  GENERIC_FAILURE
3367  */
3368 #define RIL_REQUEST_SET_TTY_MODE 80
3369
3370 /**
3371  * RIL_REQUEST_QUERY_TTY_MODE
3372  *
3373  * Request the setting of TTY mode
3374  *
3375  * "data" is NULL
3376  *
3377  * "response" is int *
3378  * ((int *)response)[0] is == 0 for TTY off
3379  * ((int *)response)[0] is == 1 for TTY Full
3380  * ((int *)response)[0] is == 2 for TTY HCO (hearing carryover)
3381  * ((int *)response)[0] is == 3 for TTY VCO (voice carryover)
3382  *
3383  * "response" is NULL
3384  *
3385  * Valid errors:
3386  *  SUCCESS
3387  *  RADIO_NOT_AVAILABLE
3388  *  GENERIC_FAILURE
3389  */
3390 #define RIL_REQUEST_QUERY_TTY_MODE 81
3391
3392 /**
3393  * RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE
3394  *
3395  * Request to set the preferred voice privacy mode used in voice
3396  * scrambling
3397  *
3398  * "data" is int *
3399  * ((int *)data)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask)
3400  * ((int *)data)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask)
3401  *
3402  * "response" is NULL
3403  *
3404  * Valid errors:
3405  *  SUCCESS
3406  *  RADIO_NOT_AVAILABLE
3407  *  GENERIC_FAILURE
3408  */
3409 #define RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE 82
3410
3411 /**
3412  * RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE
3413  *
3414  * Request the setting of preferred voice privacy mode
3415  *
3416  * "data" is NULL
3417  *
3418  * "response" is int *
3419  * ((int *)response)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask)
3420  * ((int *)response)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask)
3421  *
3422  * "response" is NULL
3423  *
3424  * Valid errors:
3425  *  SUCCESS
3426  *  RADIO_NOT_AVAILABLE
3427  *  GENERIC_FAILURE
3428  */
3429 #define RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE 83
3430
3431 /**
3432  * RIL_REQUEST_CDMA_FLASH
3433  *
3434  * Send FLASH
3435  *
3436  * "data" is const char *
3437  * ((const char *)data)[0] is a FLASH string
3438  *
3439  * "response" is NULL
3440  *
3441  * Valid errors:
3442  *  SUCCESS
3443  *  RADIO_NOT_AVAILABLE
3444  *  GENERIC_FAILURE
3445  *
3446  */
3447 #define RIL_REQUEST_CDMA_FLASH 84
3448
3449 /**
3450  * RIL_REQUEST_CDMA_BURST_DTMF
3451  *
3452  * Send DTMF string
3453  *
3454  * "data" is const char **
3455  * ((const char **)data)[0] is a DTMF string
3456  * ((const char **)data)[1] is the DTMF ON length in milliseconds, or 0 to use
3457  *                          default
3458  * ((const char **)data)[2] is the DTMF OFF length in milliseconds, or 0 to use
3459  *                          default
3460  *
3461  * "response" is NULL
3462  *
3463  * Valid errors:
3464  *  SUCCESS
3465  *  RADIO_NOT_AVAILABLE
3466  *  GENERIC_FAILURE
3467  *
3468  */
3469 #define RIL_REQUEST_CDMA_BURST_DTMF 85
3470
3471 /**
3472  * RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY
3473  *
3474  * Takes a 26 digit string (20 digit AKEY + 6 digit checksum).
3475  * If the checksum is valid the 20 digit AKEY is written to NV,
3476  * replacing the existing AKEY no matter what it was before.
3477  *
3478  * "data" is const char *
3479  * ((const char *)data)[0] is a 26 digit string (ASCII digits '0'-'9')
3480  *                         where the last 6 digits are a checksum of the
3481  *                         first 20, as specified in TR45.AHAG
3482  *                         "Common Cryptographic Algorithms, Revision D.1
3483  *                         Section 2.2"
3484  *
3485  * "response" is NULL
3486  *
3487  * Valid errors:
3488  *  SUCCESS
3489  *  RADIO_NOT_AVAILABLE
3490  *  GENERIC_FAILURE
3491  *
3492  */
3493 #define RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY 86
3494
3495 /**
3496  * RIL_REQUEST_CDMA_SEND_SMS
3497  *
3498  * Send a CDMA SMS message
3499  *
3500  * "data" is const RIL_CDMA_SMS_Message *
3501  *
3502  * "response" is a const RIL_SMS_Response *
3503  *
3504  * Based on the return error, caller decides to resend if sending sms
3505  * fails. The CDMA error class is derived as follows,
3506  * SUCCESS is error class 0 (no error)
3507  * SMS_SEND_FAIL_RETRY is error class 2 (temporary failure)
3508  * and GENERIC_FAILURE is error class 3 (permanent and no retry)
3509  *
3510  * Valid errors:
3511  *  SUCCESS
3512  *  RADIO_NOT_AVAILABLE
3513  *  SMS_SEND_FAIL_RETRY
3514  *  GENERIC_FAILURE
3515  *
3516  */
3517 #define RIL_REQUEST_CDMA_SEND_SMS 87
3518
3519 /**
3520  * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE
3521  *
3522  * Acknowledge the success or failure in the receipt of SMS
3523  * previously indicated via RIL_UNSOL_RESPONSE_CDMA_NEW_SMS
3524  *
3525  * "data" is const RIL_CDMA_SMS_Ack *
3526  *
3527  * "response" is NULL
3528  *
3529  * Valid errors:
3530  *  SUCCESS
3531  *  RADIO_NOT_AVAILABLE
3532  *  GENERIC_FAILURE
3533  *
3534  */
3535 #define RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE 88
3536
3537 /**
3538  * RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG
3539  *
3540  * Request the setting of GSM/WCDMA Cell Broadcast SMS config.
3541  *
3542  * "data" is NULL
3543  *
3544  * "response" is a const RIL_GSM_BroadcastSmsConfigInfo **
3545  * "responselen" is count * sizeof (RIL_GSM_BroadcastSmsConfigInfo *)
3546  *
3547  * Valid errors:
3548  *  SUCCESS
3549  *  RADIO_NOT_AVAILABLE
3550  *  GENERIC_FAILURE
3551  *
3552  */
3553 #define RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG 89
3554
3555 /**
3556  * RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG
3557  *
3558  * Set GSM/WCDMA Cell Broadcast SMS config
3559  *
3560  * "data" is a const RIL_GSM_BroadcastSmsConfigInfo **
3561  * "datalen" is count * sizeof(RIL_GSM_BroadcastSmsConfigInfo *)
3562  *
3563  * "response" is NULL
3564  *
3565  * Valid errors:
3566  *  SUCCESS
3567  *  RADIO_NOT_AVAILABLE
3568  *  GENERIC_FAILURE
3569  *
3570  */
3571 #define RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG 90
3572
3573 /**
3574  * RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION
3575  *
3576 * Enable or disable the reception of GSM/WCDMA Cell Broadcast SMS
3577  *
3578  * "data" is const int *
3579  * (const int *)data[0] indicates to activate or turn off the
3580  * reception of GSM/WCDMA Cell Broadcast SMS, 0-1,
3581  *                       0 - Activate, 1 - Turn off
3582  *
3583  * "response" is NULL
3584  *
3585  * Valid errors:
3586  *  SUCCESS
3587  *  RADIO_NOT_AVAILABLE
3588  *  GENERIC_FAILURE
3589  *
3590  */
3591 #define RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION 91
3592
3593 /**
3594  * RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG
3595  *
3596  * Request the setting of CDMA Broadcast SMS config
3597  *
3598  * "data" is NULL
3599  *
3600  * "response" is a const RIL_CDMA_BroadcastSmsConfigInfo **
3601  * "responselen" is count * sizeof (RIL_CDMA_BroadcastSmsConfigInfo *)
3602  *
3603  * Valid errors:
3604  *  SUCCESS
3605  *  RADIO_NOT_AVAILABLE
3606  *  GENERIC_FAILURE
3607  *
3608  */
3609 #define RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG 92
3610
3611 /**
3612  * RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG
3613  *
3614  * Set CDMA Broadcast SMS config
3615  *
3616  * "data" is an const RIL_CDMA_BroadcastSmsConfigInfo **
3617  * "datalen" is count * sizeof(const RIL_CDMA_BroadcastSmsConfigInfo *)
3618  *
3619  * "response" is NULL
3620  *
3621  * Valid errors:
3622  *  SUCCESS
3623  *  RADIO_NOT_AVAILABLE
3624  *  GENERIC_FAILURE
3625  *
3626  */
3627 #define RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG 93
3628
3629 /**
3630  * RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION
3631  *
3632  * Enable or disable the reception of CDMA Broadcast SMS
3633  *
3634  * "data" is const int *
3635  * (const int *)data[0] indicates to activate or turn off the
3636  * reception of CDMA Broadcast SMS, 0-1,
3637  *                       0 - Activate, 1 - Turn off
3638  *
3639  * "response" is NULL
3640  *
3641  * Valid errors:
3642  *  SUCCESS
3643  *  RADIO_NOT_AVAILABLE
3644  *  GENERIC_FAILURE
3645  *
3646  */
3647 #define RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION 94
3648
3649 /**
3650  * RIL_REQUEST_CDMA_SUBSCRIPTION
3651  *
3652  * Request the device MDN / H_SID / H_NID.
3653  *
3654  * The request is only allowed when CDMA subscription is available.  When CDMA
3655  * subscription is changed, application layer should re-issue the request to
3656  * update the subscription information.
3657  *
3658  * If a NULL value is returned for any of the device id, it means that error
3659  * accessing the device.
3660  *
3661  * "response" is const char **
3662  * ((const char **)response)[0] is MDN if CDMA subscription is available
3663  * ((const char **)response)[1] is a comma separated list of H_SID (Home SID) if
3664  *                              CDMA subscription is available, in decimal format
3665  * ((const char **)response)[2] is a comma separated list of H_NID (Home NID) if
3666  *                              CDMA subscription is available, in decimal format
3667  * ((const char **)response)[3] is MIN (10 digits, MIN2+MIN1) if CDMA subscription is available
3668  * ((const char **)response)[4] is PRL version if CDMA subscription is available
3669  *
3670  * Valid errors:
3671  *  SUCCESS
3672  *  RIL_E_SUBSCRIPTION_NOT_AVAILABLE
3673  */
3674
3675 #define RIL_REQUEST_CDMA_SUBSCRIPTION 95
3676
3677 /**
3678  * RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM
3679  *
3680  * Stores a CDMA SMS message to RUIM memory.
3681  *
3682  * "data" is RIL_CDMA_SMS_WriteArgs *
3683  *
3684  * "response" is int *
3685  * ((const int *)response)[0] is the record index where the message is stored.
3686  *
3687  * Valid errors:
3688  *  SUCCESS
3689  *  RADIO_NOT_AVAILABLE
3690  *  GENERIC_FAILURE
3691  *
3692  */
3693 #define RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM 96
3694
3695 /**
3696  * RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM
3697  *
3698  * Deletes a CDMA SMS message from RUIM memory.
3699  *
3700  * "data" is int  *
3701  * ((int *)data)[0] is the record index of the message to delete.
3702  *
3703  * "response" is NULL
3704  *
3705  * Valid errors:
3706  *  SUCCESS
3707  *  RADIO_NOT_AVAILABLE
3708  *  GENERIC_FAILURE
3709  *
3710  */
3711 #define RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM 97
3712
3713 /**
3714  * RIL_REQUEST_DEVICE_IDENTITY
3715  *
3716  * Request the device ESN / MEID / IMEI / IMEISV.
3717  *
3718  * The request is always allowed and contains GSM and CDMA device identity;
3719  * it substitutes the deprecated requests RIL_REQUEST_GET_IMEI and
3720  * RIL_REQUEST_GET_IMEISV.
3721  *
3722  * If a NULL value is returned for any of the device id, it means that error
3723  * accessing the device.
3724  *
3725  * When CDMA subscription is changed the ESN/MEID may change.  The application
3726  * layer should re-issue the request to update the device identity in this case.
3727  *
3728  * "response" is const char **
3729  * ((const char **)response)[0] is IMEI if GSM subscription is available
3730  * ((const char **)response)[1] is IMEISV if GSM subscription is available
3731  * ((const char **)response)[2] is ESN if CDMA subscription is available
3732  * ((const char **)response)[3] is MEID if CDMA subscription is available
3733  *
3734  * Valid errors:
3735  *  SUCCESS
3736  *  RADIO_NOT_AVAILABLE
3737  *  GENERIC_FAILURE
3738  */
3739 #define RIL_REQUEST_DEVICE_IDENTITY 98
3740
3741 /**
3742  * RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE
3743  *
3744  * Request the radio's system selection module to exit emergency
3745  * callback mode.  RIL will not respond with SUCCESS until the modem has
3746  * completely exited from Emergency Callback Mode.
3747  *
3748  * "data" is NULL
3749  *
3750  * "response" is NULL
3751  *
3752  * Valid errors:
3753  *  SUCCESS
3754  *  RADIO_NOT_AVAILABLE
3755  *  GENERIC_FAILURE
3756  *
3757  */
3758 #define RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE 99
3759
3760 /**
3761  * RIL_REQUEST_GET_SMSC_ADDRESS
3762  *
3763  * Queries the default Short Message Service Center address on the device.
3764  *
3765  * "data" is NULL
3766  *
3767  * "response" is const char * containing the SMSC address.
3768  *
3769  * Valid errors:
3770  *  SUCCESS
3771  *  RADIO_NOT_AVAILABLE
3772  *  GENERIC_FAILURE
3773  *
3774  */
3775 #define RIL_REQUEST_GET_SMSC_ADDRESS 100
3776
3777 /**
3778  * RIL_REQUEST_SET_SMSC_ADDRESS
3779  *
3780  * Sets the default Short Message Service Center address on the device.
3781  *
3782  * "data" is const char * containing the SMSC address.
3783  *
3784  * "response" is NULL
3785  *
3786  * Valid errors:
3787  *  SUCCESS
3788  *  RADIO_NOT_AVAILABLE
3789  *  GENERIC_FAILURE
3790  *
3791  */
3792 #define RIL_REQUEST_SET_SMSC_ADDRESS 101
3793
3794 /**
3795  * RIL_REQUEST_REPORT_SMS_MEMORY_STATUS
3796  *
3797  * Indicates whether there is storage available for new SMS messages.
3798  *
3799  * "data" is int *
3800  * ((int *)data)[0] is 1 if memory is available for storing new messages
3801  *                  is 0 if memory capacity is exceeded
3802  *
3803  * "response" is NULL
3804  *
3805  * Valid errors:
3806  *  SUCCESS
3807  *  RADIO_NOT_AVAILABLE
3808  *  GENERIC_FAILURE
3809  *
3810  */
3811 #define RIL_REQUEST_REPORT_SMS_MEMORY_STATUS 102
3812
3813 /**
3814  * RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING
3815  *
3816  * Indicates that the StkSerivce is running and is
3817  * ready to receive RIL_UNSOL_STK_XXXXX commands.
3818  *
3819  * "data" is NULL
3820  * "response" is NULL
3821  *
3822  * Valid errors:
3823  *  SUCCESS
3824  *  RADIO_NOT_AVAILABLE
3825  *  GENERIC_FAILURE
3826  *
3827  */
3828 #define RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING 103
3829
3830 /**
3831  * RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE
3832  *
3833  * Request to query the location where the CDMA subscription shall
3834  * be retrieved
3835  *
3836  * "data" is NULL
3837  *
3838  * "response" is int *
3839  * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
3840  *
3841  * Valid errors:
3842  *  SUCCESS
3843  *  RADIO_NOT_AVAILABLE
3844  *  GENERIC_FAILURE
3845  *  SUBSCRIPTION_NOT_AVAILABLE
3846  *
3847  * See also: RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE
3848  */
3849 #define RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE 104
3850
3851 /**
3852  * RIL_REQUEST_ISIM_AUTHENTICATION
3853  *
3854  * Request the ISIM application on the UICC to perform AKA
3855  * challenge/response algorithm for IMS authentication
3856  *
3857  * "data" is a const char * containing the challenge string in Base64 format
3858  * "response" is a const char * containing the response in Base64 format
3859  *
3860  * Valid errors:
3861  *  SUCCESS
3862  *  RADIO_NOT_AVAILABLE
3863  *  GENERIC_FAILURE
3864  */
3865 #define RIL_REQUEST_ISIM_AUTHENTICATION 105
3866
3867 /**
3868  * RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU
3869  *
3870  * Acknowledge successful or failed receipt of SMS previously indicated
3871  * via RIL_UNSOL_RESPONSE_NEW_SMS, including acknowledgement TPDU to send
3872  * as the RP-User-Data element of the RP-ACK or RP-ERROR PDU.
3873  *
3874  * "data" is const char **
3875  * ((const char **)data)[0] is "1" on successful receipt (send RP-ACK)
3876  *                          is "0" on failed receipt (send RP-ERROR)
3877  * ((const char **)data)[1] is the acknowledgement TPDU in hexadecimal format
3878  *
3879  * "response" is NULL
3880  *
3881  * Valid errors:
3882  *  SUCCESS
3883  *  RADIO_NOT_AVAILABLE
3884  *  GENERIC_FAILURE
3885  */
3886 #define RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU 106
3887
3888 /**
3889  * RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS
3890  *
3891  * Requests to send a SAT/USAT envelope command to SIM.
3892  * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111.
3893  *
3894  * This request has one difference from RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND:
3895  * the SW1 and SW2 status bytes from the UICC response are returned along with
3896  * the response data, using the same structure as RIL_REQUEST_SIM_IO.
3897  *
3898  * The RIL implementation shall perform the normal processing of a '91XX'
3899  * response in SW1/SW2 to retrieve the pending proactive command and send it
3900  * as an unsolicited response, as RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND does.
3901  *
3902  * "data" is a const char * containing the SAT/USAT command
3903  * in hexadecimal format starting with command tag
3904  *
3905  * "response" is a const RIL_SIM_IO_Response *
3906  *
3907  * Valid errors:
3908  *  RIL_E_SUCCESS
3909  *  RIL_E_RADIO_NOT_AVAILABLE (radio resetting)
3910  *  RIL_E_GENERIC_FAILURE
3911  */
3912 #define RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS 107
3913
3914 /**
3915  * RIL_REQUEST_VOICE_RADIO_TECH
3916  *
3917  * Query the radio technology type (3GPP/3GPP2) used for voice. Query is valid only
3918  * when radio state is RADIO_STATE_ON
3919  *
3920  * "data" is NULL
3921  * "response" is int *
3922  * ((int *) response)[0] is of type const RIL_RadioTechnology
3923  *
3924  * Valid errors:
3925  *  SUCCESS
3926  *  RADIO_NOT_AVAILABLE
3927  *  GENERIC_FAILURE
3928  */
3929 #define RIL_REQUEST_VOICE_RADIO_TECH 108
3930
3931 /**
3932  * RIL_REQUEST_GET_CELL_INFO_LIST
3933  *
3934  * Request all of the current cell information known to the radio. The radio
3935  * must a list of all current cells, including the neighboring cells. If for a particular
3936  * cell information isn't known then the appropriate unknown value will be returned.
3937  * This does not cause or change the rate of RIL_UNSOL_CELL_INFO_LIST.
3938  *
3939  * "data" is NULL
3940  *
3941  * "response" is an array of  RIL_CellInfo.
3942  */
3943 #define RIL_REQUEST_GET_CELL_INFO_LIST 109
3944
3945 /**
3946  * RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE
3947  *
3948  * Sets the minimum time between when RIL_UNSOL_CELL_INFO_LIST should be invoked.
3949  * A value of 0, means invoke RIL_UNSOL_CELL_INFO_LIST when any of the reported
3950  * information changes. Setting the value to INT_MAX(0x7fffffff) means never issue
3951  * a RIL_UNSOL_CELL_INFO_LIST.
3952  *
3953  * "data" is int *
3954  * ((int *)data)[0] is minimum time in milliseconds
3955  *
3956  * "response" is NULL
3957  *
3958  * Valid errors:
3959  *  SUCCESS
3960  *  RADIO_NOT_AVAILABLE
3961  *  GENERIC_FAILURE
3962  */
3963 #define RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE 110
3964
3965 /**
3966  * RIL_REQUEST_SET_INITIAL_ATTACH_APN
3967  *
3968  * Set an apn to initial attach network
3969  * "response" is NULL
3970  *
3971  * Valid errors:
3972  *  SUCCESS
3973  *  RADIO_NOT_AVAILABLE (radio resetting)
3974  *  GENERIC_FAILURE
3975  *  SUBSCRIPTION_NOT_AVAILABLE
3976  */
3977 #define RIL_REQUEST_SET_INITIAL_ATTACH_APN 111
3978
3979 /**
3980  * RIL_REQUEST_IMS_REGISTRATION_STATE
3981  *
3982  * Request current IMS registration state
3983  *
3984  * "data" is NULL
3985  *
3986  * "response" is int *
3987  * ((int *)response)[0] is registration state:
3988  *              0 - Not registered
3989  *              1 - Registered
3990  *
3991  * If ((int*)response)[0] is = 1, then ((int *) response)[1]
3992  * must follow with IMS SMS format:
3993  *
3994  * ((int *) response)[1] is of type RIL_RadioTechnologyFamily
3995  *
3996  * Valid errors:
3997  *  SUCCESS
3998  *  RADIO_NOT_AVAILABLE
3999  *  GENERIC_FAILURE
4000  */
4001 #define RIL_REQUEST_IMS_REGISTRATION_STATE 112
4002
4003 /**
4004  * RIL_REQUEST_IMS_SEND_SMS
4005  *
4006  * Send a SMS message over IMS
4007  *
4008  * "data" is const RIL_IMS_SMS_Message *
4009  *
4010  * "response" is a const RIL_SMS_Response *
4011  *
4012  * Based on the return error, caller decides to resend if sending sms
4013  * fails. SMS_SEND_FAIL_RETRY means retry, and other errors means no retry.
4014  * In case of retry, data is encoded based on Voice Technology available.
4015  *
4016  * Valid errors:
4017  *  SUCCESS
4018  *  RADIO_NOT_AVAILABLE
4019  *  SMS_SEND_FAIL_RETRY
4020  *  FDN_CHECK_FAILURE
4021  *  GENERIC_FAILURE
4022  *
4023  */
4024 #define RIL_REQUEST_IMS_SEND_SMS 113
4025
4026 /**
4027  * RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC
4028  *
4029  * Request APDU exchange on the basic channel. This command reflects TS 27.007
4030  * "generic SIM access" operation (+CSIM). The modem must ensure proper function
4031  * of GSM/CDMA, and filter commands appropriately. It should filter
4032  * channel management and SELECT by DF name commands.
4033  *
4034  * "data" is a const RIL_SIM_APDU *
4035  * "sessionid" field should be ignored.
4036  *
4037  * "response" is a const RIL_SIM_IO_Response *
4038  *
4039  * Valid errors:
4040  *  SUCCESS
4041  *  RADIO_NOT_AVAILABLE
4042  *  GENERIC_FAILURE
4043  */
4044 #define RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC 114
4045
4046 /**
4047  * RIL_REQUEST_SIM_OPEN_CHANNEL
4048  *
4049  * Open a new logical channel and select the given application. This command
4050  * reflects TS 27.007 "open logical channel" operation (+CCHO).
4051  *
4052  * "data" is const char * and set to AID value, See ETSI 102.221 and 101.220.
4053  *
4054  * "response" is int *
4055  * ((int *)data)[0] contains the session id of the logical channel.
4056  * ((int *)data)[1] onwards may optionally contain the select response for the
4057  *     open channel command with one byte per integer.
4058  *
4059  * Valid errors:
4060  *  SUCCESS
4061  *  RADIO_NOT_AVAILABLE
4062  *  GENERIC_FAILURE
4063  *  MISSING_RESOURCE
4064  *  NO_SUCH_ELEMENT
4065  */
4066 #define RIL_REQUEST_SIM_OPEN_CHANNEL 115
4067
4068 /**
4069  * RIL_REQUEST_SIM_CLOSE_CHANNEL
4070  *
4071  * Close a previously opened logical channel. This command reflects TS 27.007
4072  * "close logical channel" operation (+CCHC).
4073  *
4074  * "data" is int *
4075  * ((int *)data)[0] is the session id of logical the channel to close.
4076  *
4077  * "response" is NULL
4078  *
4079  * Valid errors:
4080  *  SUCCESS
4081  *  RADIO_NOT_AVAILABLE
4082  *  GENERIC_FAILURE
4083  */
4084 #define RIL_REQUEST_SIM_CLOSE_CHANNEL 116
4085
4086 /**
4087  * RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL
4088  *
4089  * Exchange APDUs with a UICC over a previously opened logical channel. This
4090  * command reflects TS 27.007 "generic logical channel access" operation
4091  * (+CGLA). The modem should filter channel management and SELECT by DF name
4092  * commands.
4093  *
4094  * "data" is a const RIL_SIM_APDU*
4095  *
4096  * "response" is a const RIL_SIM_IO_Response *
4097  *
4098  * Valid errors:
4099  *  SUCCESS
4100  *  RADIO_NOT_AVAILABLE
4101  *  GENERIC_FAILURE
4102  */
4103 #define RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL 117
4104
4105 /**
4106  * RIL_REQUEST_NV_READ_ITEM
4107  *
4108  * Read one of the radio NV items defined in RadioNVItems.java / ril_nv_items.h.
4109  * This is used for device configuration by some CDMA operators.
4110  *
4111  * "data" is a const RIL_NV_ReadItem *
4112  *
4113  * "response" is const char * containing the contents of the NV item
4114  *
4115  * Valid errors:
4116  *  SUCCESS
4117  *  RADIO_NOT_AVAILABLE
4118  *  GENERIC_FAILURE
4119  */
4120 #define RIL_REQUEST_NV_READ_ITEM 118
4121
4122 /**
4123  * RIL_REQUEST_NV_WRITE_ITEM
4124  *
4125  * Write one of the radio NV items defined in RadioNVItems.java / ril_nv_items.h.
4126  * This is used for device configuration by some CDMA operators.
4127  *
4128  * "data" is a const RIL_NV_WriteItem *
4129  *
4130  * "response" is NULL
4131  *
4132  * Valid errors:
4133  *  SUCCESS
4134  *  RADIO_NOT_AVAILABLE
4135  *  GENERIC_FAILURE
4136  */
4137 #define RIL_REQUEST_NV_WRITE_ITEM 119
4138
4139 /**
4140  * RIL_REQUEST_NV_WRITE_CDMA_PRL
4141  *
4142  * Update the CDMA Preferred Roaming List (PRL) in the radio NV storage.
4143  * This is used for device configuration by some CDMA operators.
4144  *
4145  * "data" is a const char * containing the PRL as a byte array
4146  *
4147  * "response" is NULL
4148  *
4149  * Valid errors:
4150  *  SUCCESS
4151  *  RADIO_NOT_AVAILABLE
4152  *  GENERIC_FAILURE
4153  */
4154 #define RIL_REQUEST_NV_WRITE_CDMA_PRL 120
4155
4156 /**
4157  * RIL_REQUEST_NV_RESET_CONFIG
4158  *
4159  * Reset the radio NV configuration to the factory state.
4160  * This is used for device configuration by some CDMA operators.
4161  *
4162  * "data" is int *
4163  * ((int *)data)[0] is 1 to reload all NV items
4164  * ((int *)data)[0] is 2 for erase NV reset (SCRTN)
4165  * ((int *)data)[0] is 3 for factory reset (RTN)
4166  *
4167  * "response" is NULL
4168  *
4169  * Valid errors:
4170  *  SUCCESS
4171  *  RADIO_NOT_AVAILABLE
4172  *  GENERIC_FAILURE
4173  */
4174 #define RIL_REQUEST_NV_RESET_CONFIG 121
4175
4176  /** RIL_REQUEST_SET_UICC_SUBSCRIPTION
4177  * FIXME This API needs to have more documentation.
4178  *
4179  * Selection/de-selection of a subscription from a SIM card
4180  * "data" is const  RIL_SelectUiccSub*
4181
4182  *
4183  * "response" is NULL
4184  *
4185  *  Valid errors:
4186  *  SUCCESS
4187  *  RADIO_NOT_AVAILABLE (radio resetting)
4188  *  GENERIC_FAILURE
4189  *  SUBSCRIPTION_NOT_SUPPORTED
4190  *
4191  */
4192 #define RIL_REQUEST_SET_UICC_SUBSCRIPTION  122
4193
4194 /**
4195  *  RIL_REQUEST_ALLOW_DATA
4196  *
4197  *  Tells the modem whether data calls are allowed or not
4198  *
4199  * "data" is int *
4200  * FIXME slotId and aid will be added.
4201  * ((int *)data)[0] is == 0 to allow data calls
4202  * ((int *)data)[0] is == 1 to disallow data calls
4203  *
4204  * "response" is NULL
4205  *
4206  *  Valid errors:
4207  *
4208  *  SUCCESS
4209  *  RADIO_NOT_AVAILABLE (radio resetting)
4210  *  GENERIC_FAILURE
4211  *
4212  */
4213 #define RIL_REQUEST_ALLOW_DATA  123
4214
4215 /**
4216  * RIL_REQUEST_GET_HARDWARE_CONFIG
4217  *
4218  * Request all of the current hardware (modem and sim) associated
4219  * with the RIL.
4220  *
4221  * "data" is NULL
4222  *
4223  * "response" is an array of  RIL_HardwareConfig.
4224  */
4225 #define RIL_REQUEST_GET_HARDWARE_CONFIG 124
4226
4227 /**
4228  * RIL_REQUEST_SIM_AUTHENTICATION
4229  *
4230  * Returns the response of SIM Authentication through RIL to a
4231  * challenge request.
4232  *
4233  * "data" Base64 encoded string containing challenge:
4234  *      int   authContext;          P2 value of authentication command, see P2 parameter in
4235  *                                  3GPP TS 31.102 7.1.2
4236  *      char *authData;             the challenge string in Base64 format, see 3GPP
4237  *                                  TS 31.102 7.1.2
4238  *      char *aid;                  AID value, See ETSI 102.221 8.1 and 101.220 4,
4239  *                                  NULL if no value
4240  *
4241  * "response" Base64 encoded strings containing response:
4242  *      int   sw1;                  Status bytes per 3GPP TS 31.102 section 7.3
4243  *      int   sw2;
4244  *      char *simResponse;          Response in Base64 format, see 3GPP TS 31.102 7.1.2
4245  */
4246 #define RIL_REQUEST_SIM_AUTHENTICATION 125
4247
4248 /**
4249  * RIL_REQUEST_GET_DC_RT_INFO
4250  *
4251  * Requests the Data Connection Real Time Info
4252  *
4253  * "data" is NULL
4254  *
4255  * "response" is the most recent RIL_DcRtInfo
4256  *
4257  * Valid errors:
4258  *  SUCCESS
4259  *  RADIO_NOT_AVAILABLE
4260  *  GENERIC_FAILURE
4261  *
4262  * See also: RIL_UNSOL_DC_RT_INFO_CHANGED
4263  */
4264 #define RIL_REQUEST_GET_DC_RT_INFO 126
4265
4266 /**
4267  * RIL_REQUEST_SET_DC_RT_INFO_RATE
4268  *
4269  * This is the minimum number of milliseconds between successive
4270  * RIL_UNSOL_DC_RT_INFO_CHANGED messages and defines the highest rate
4271  * at which RIL_UNSOL_DC_RT_INFO_CHANGED's will be sent. A value of
4272  * 0 means send as fast as possible.
4273  *
4274  * "data" The number of milliseconds as an int
4275  *
4276  * "response" is null
4277  *
4278  * Valid errors:
4279  *  SUCCESS must not fail
4280  */
4281 #define RIL_REQUEST_SET_DC_RT_INFO_RATE 127
4282
4283 /**
4284  * RIL_REQUEST_SET_DATA_PROFILE
4285  *
4286  * Set data profile in modem
4287  * Modem should erase existed profiles from framework, and apply new profiles
4288  * "data" is an const RIL_DataProfileInfo **
4289  * "datalen" is count * sizeof(const RIL_DataProfileInfo *)
4290  * "response" is NULL
4291  *
4292  * Valid errors:
4293  *  SUCCESS
4294  *  RADIO_NOT_AVAILABLE (radio resetting)
4295  *  GENERIC_FAILURE
4296  *  SUBSCRIPTION_NOT_AVAILABLE
4297  */
4298 #define RIL_REQUEST_SET_DATA_PROFILE 128
4299
4300 /**
4301  * RIL_REQUEST_SHUTDOWN
4302  *
4303  * Device is shutting down. All further commands are ignored
4304  * and RADIO_NOT_AVAILABLE must be returned.
4305  *
4306  * "data" is null
4307  * "response" is NULL
4308  *
4309  * Valid errors:
4310  *  SUCCESS
4311  *  RADIO_NOT_AVAILABLE
4312  *  GENERIC_FAILURE
4313  */
4314 #define RIL_REQUEST_SHUTDOWN 129
4315
4316 /**
4317  * RIL_REQUEST_GET_RADIO_CAPABILITY
4318  *
4319  * Used to get phone radio capablility.
4320  *
4321  * "data" is int *
4322  * ((int *)data)[0] is the phone radio access family defined in
4323  * RadioAccessFamily. It's a bit mask value to represent the support type.
4324  *
4325  * Valid errors:
4326  *  SUCCESS
4327  *  RADIO_NOT_AVAILABLE
4328  *  GENERIC_FAILURE
4329  */
4330 #define RIL_REQUEST_GET_RADIO_CAPABILITY 130
4331
4332 /**
4333  * RIL_REQUEST_SET_RADIO_CAPABILITY
4334  *
4335  * Used to set the phones radio capability. Be VERY careful
4336  * using this request as it may cause some vendor modems to reset. Because
4337  * of the possible modem reset any RIL commands after this one may not be
4338  * processed.
4339  *
4340  * "data" is the RIL_RadioCapability structure
4341  *
4342  * "response" is the RIL_RadioCapability structure, used to feedback return status
4343  *
4344  * Valid errors:
4345  *  SUCCESS means a RIL_UNSOL_RADIO_CAPABILITY will be sent within 30 seconds.
4346  *  RADIO_NOT_AVAILABLE
4347  *  GENERIC_FAILURE
4348  */
4349 #define RIL_REQUEST_SET_RADIO_CAPABILITY 131
4350
4351
4352 /***********************************************************************/
4353
4354
4355 #define RIL_UNSOL_RESPONSE_BASE 1000
4356
4357 /**
4358  * RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED
4359  *
4360  * Indicate when value of RIL_RadioState has changed.
4361  *
4362  * Callee will invoke RIL_RadioStateRequest method on main thread
4363  *
4364  * "data" is NULL
4365  */
4366
4367 #define RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED 1000
4368
4369
4370 /**
4371  * RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED
4372  *
4373  * Indicate when call state has changed
4374  *
4375  * Callee will invoke RIL_REQUEST_GET_CURRENT_CALLS on main thread
4376  *
4377  * "data" is NULL
4378  *
4379  * Response should be invoked on, for example,
4380  * "RING", "BUSY", "NO CARRIER", and also call state
4381  * transitions (DIALING->ALERTING ALERTING->ACTIVE)
4382  *
4383  * Redundent or extraneous invocations are tolerated
4384  */
4385 #define RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED 1001
4386
4387
4388 /**
4389  * RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED
4390  *
4391  * Called when the voice network state changed
4392  *
4393  * Callee will invoke the following requests on main thread:
4394  *
4395  * RIL_REQUEST_VOICE_REGISTRATION_STATE
4396  * RIL_REQUEST_OPERATOR
4397  *
4398  * "data" is NULL
4399  *
4400  * FIXME should this happen when SIM records are loaded? (eg, for
4401  * EONS)
4402  */
4403 #define RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED 1002
4404
4405 /**
4406  * RIL_UNSOL_RESPONSE_NEW_SMS
4407  *
4408  * Called when new SMS is received.
4409  *
4410  * "data" is const char *
4411  * This is a pointer to a string containing the PDU of an SMS-DELIVER
4412  * as an ascii string of hex digits. The PDU starts with the SMSC address
4413  * per TS 27.005 (+CMT:)
4414  *
4415  * Callee will subsequently confirm the receipt of thei SMS with a
4416  * RIL_REQUEST_SMS_ACKNOWLEDGE
4417  *
4418  * No new RIL_UNSOL_RESPONSE_NEW_SMS
4419  * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
4420  * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
4421  */
4422
4423 #define RIL_UNSOL_RESPONSE_NEW_SMS 1003
4424
4425 /**
4426  * RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT
4427  *
4428  * Called when new SMS Status Report is received.
4429  *
4430  * "data" is const char *
4431  * This is a pointer to a string containing the PDU of an SMS-STATUS-REPORT
4432  * as an ascii string of hex digits. The PDU starts with the SMSC address
4433  * per TS 27.005 (+CDS:).
4434  *
4435  * Callee will subsequently confirm the receipt of the SMS with a
4436  * RIL_REQUEST_SMS_ACKNOWLEDGE
4437  *
4438  * No new RIL_UNSOL_RESPONSE_NEW_SMS
4439  * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a
4440  * RIL_REQUEST_SMS_ACKNOWLEDGE has been received
4441  */
4442
4443 #define RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT 1004
4444
4445 /**
4446  * RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM
4447  *
4448  * Called when new SMS has been stored on SIM card
4449  *
4450  * "data" is const int *
4451  * ((const int *)data)[0] contains the slot index on the SIM that contains
4452  * the new message
4453  */
4454
4455 #define RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM 1005
4456
4457 /**
4458  * RIL_UNSOL_ON_USSD
4459  *
4460  * Called when a new USSD message is received.
4461  *
4462  * "data" is const char **
4463  * ((const char **)data)[0] points to a type code, which is
4464  *  one of these string values:
4465  *      "0"   USSD-Notify -- text in ((const char **)data)[1]
4466  *      "1"   USSD-Request -- text in ((const char **)data)[1]
4467  *      "2"   Session terminated by network
4468  *      "3"   other local client (eg, SIM Toolkit) has responded
4469  *      "4"   Operation not supported
4470  *      "5"   Network timeout
4471  *
4472  * The USSD session is assumed to persist if the type code is "1", otherwise
4473  * the current session (if any) is assumed to have terminated.
4474  *
4475  * ((const char **)data)[1] points to a message string if applicable, which
4476  * should always be in UTF-8.
4477  */
4478 #define RIL_UNSOL_ON_USSD 1006
4479 /* Previously #define RIL_UNSOL_ON_USSD_NOTIFY 1006   */
4480
4481 /**
4482  * RIL_UNSOL_ON_USSD_REQUEST
4483  *
4484  * Obsolete. Send via RIL_UNSOL_ON_USSD
4485  */
4486 #define RIL_UNSOL_ON_USSD_REQUEST 1007
4487
4488 /**
4489  * RIL_UNSOL_NITZ_TIME_RECEIVED
4490  *
4491  * Called when radio has received a NITZ time message
4492  *
4493  * "data" is const char * pointing to NITZ time string
4494  * in the form "yy/mm/dd,hh:mm:ss(+/-)tz,dt"
4495  */
4496 #define RIL_UNSOL_NITZ_TIME_RECEIVED  1008
4497
4498 /**
4499  * RIL_UNSOL_SIGNAL_STRENGTH
4500  *
4501  * Radio may report signal strength rather han have it polled.
4502  *
4503  * "data" is a const RIL_SignalStrength *
4504  */
4505 #define RIL_UNSOL_SIGNAL_STRENGTH  1009
4506
4507
4508 /**
4509  * RIL_UNSOL_DATA_CALL_LIST_CHANGED
4510  *
4511  * "data" is an array of RIL_Data_Call_Response_v6 identical to that
4512  * returned by RIL_REQUEST_DATA_CALL_LIST. It is the complete list
4513  * of current data contexts including new contexts that have been
4514  * activated. A data call is only removed from this list when the
4515  * framework sends a RIL_REQUEST_DEACTIVATE_DATA_CALL or the radio
4516  * is powered off/on.
4517  *
4518  * See also: RIL_REQUEST_DATA_CALL_LIST
4519  */
4520
4521 #define RIL_UNSOL_DATA_CALL_LIST_CHANGED 1010
4522
4523 /**
4524  * RIL_UNSOL_SUPP_SVC_NOTIFICATION
4525  *
4526  * Reports supplementary service related notification from the network.
4527  *
4528  * "data" is a const RIL_SuppSvcNotification *
4529  *
4530  */
4531
4532 #define RIL_UNSOL_SUPP_SVC_NOTIFICATION 1011
4533
4534 /**
4535  * RIL_UNSOL_STK_SESSION_END
4536  *
4537  * Indicate when STK session is terminated by SIM.
4538  *
4539  * "data" is NULL
4540  */
4541 #define RIL_UNSOL_STK_SESSION_END 1012
4542
4543 /**
4544  * RIL_UNSOL_STK_PROACTIVE_COMMAND
4545  *
4546  * Indicate when SIM issue a STK proactive command to applications
4547  *
4548  * "data" is a const char * containing SAT/USAT proactive command
4549  * in hexadecimal format string starting with command tag
4550  *
4551  */
4552 #define RIL_UNSOL_STK_PROACTIVE_COMMAND 1013
4553
4554 /**
4555  * RIL_UNSOL_STK_EVENT_NOTIFY
4556  *
4557  * Indicate when SIM notifies applcations some event happens.
4558  * Generally, application does not need to have any feedback to
4559  * SIM but shall be able to indicate appropriate messages to users.
4560  *
4561  * "data" is a const char * containing SAT/USAT commands or responses
4562  * sent by ME to SIM or commands handled by ME, in hexadecimal format string
4563  * starting with first byte of response data or command tag
4564  *
4565  */
4566 #define RIL_UNSOL_STK_EVENT_NOTIFY 1014
4567
4568 /**
4569  * RIL_UNSOL_STK_CALL_SETUP
4570  *
4571  * Indicate when SIM wants application to setup a voice call.
4572  *
4573  * "data" is const int *
4574  * ((const int *)data)[0] contains timeout value (in milliseconds)
4575  */
4576 #define RIL_UNSOL_STK_CALL_SETUP 1015
4577
4578 /**
4579  * RIL_UNSOL_SIM_SMS_STORAGE_FULL
4580  *
4581  * Indicates that SMS storage on the SIM is full.  Sent when the network
4582  * attempts to deliver a new SMS message.  Messages cannot be saved on the
4583  * SIM until space is freed.  In particular, incoming Class 2 messages
4584  * cannot be stored.
4585  *
4586  * "data" is null
4587  *
4588  */
4589 #define RIL_UNSOL_SIM_SMS_STORAGE_FULL 1016
4590
4591 /**
4592  * RIL_UNSOL_SIM_REFRESH
4593  *
4594  * Indicates that file(s) on the SIM have been updated, or the SIM
4595  * has been reinitialized.
4596  *
4597  * In the case where RIL is version 6 or older:
4598  * "data" is an int *
4599  * ((int *)data)[0] is a RIL_SimRefreshResult.
4600  * ((int *)data)[1] is the EFID of the updated file if the result is
4601  * SIM_FILE_UPDATE or NULL for any other result.
4602  *
4603  * In the case where RIL is version 7:
4604  * "data" is a RIL_SimRefreshResponse_v7 *
4605  *
4606  * Note: If the SIM state changes as a result of the SIM refresh (eg,
4607  * SIM_READY -> SIM_LOCKED_OR_ABSENT), RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED
4608  * should be sent.
4609  */
4610 #define RIL_UNSOL_SIM_REFRESH 1017
4611
4612 /**
4613  * RIL_UNSOL_CALL_RING
4614  *
4615  * Ring indication for an incoming call (eg, RING or CRING event).
4616  * There must be at least one RIL_UNSOL_CALL_RING at the beginning
4617  * of a call and sending multiple is optional. If the system property
4618  * ro.telephony.call_ring.multiple is false then the upper layers
4619  * will generate the multiple events internally. Otherwise the vendor
4620  * ril must generate multiple RIL_UNSOL_CALL_RING if
4621  * ro.telephony.call_ring.multiple is true or if it is absent.
4622  *
4623  * The rate of these events is controlled by ro.telephony.call_ring.delay
4624  * and has a default value of 3000 (3 seconds) if absent.
4625  *
4626  * "data" is null for GSM
4627  * "data" is const RIL_CDMA_SignalInfoRecord * if CDMA
4628  */
4629 #define RIL_UNSOL_CALL_RING 1018
4630
4631 /**
4632  * RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED
4633  *
4634  * Indicates that SIM state changes.
4635  *
4636  * Callee will invoke RIL_REQUEST_GET_SIM_STATUS on main thread
4637
4638  * "data" is null
4639  */
4640 #define RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED 1019
4641
4642 /**
4643  * RIL_UNSOL_RESPONSE_CDMA_NEW_SMS
4644  *
4645  * Called when new CDMA SMS is received
4646  *
4647  * "data" is const RIL_CDMA_SMS_Message *
4648  *
4649  * Callee will subsequently confirm the receipt of the SMS with
4650  * a RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE
4651  *
4652  * No new RIL_UNSOL_RESPONSE_CDMA_NEW_SMS should be sent until
4653  * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE has been received
4654  *
4655  */
4656 #define RIL_UNSOL_RESPONSE_CDMA_NEW_SMS 1020
4657
4658 /**
4659  * RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS
4660  *
4661  * Called when new Broadcast SMS is received
4662  *
4663  * "data" can be one of the following:
4664  * If received from GSM network, "data" is const char of 88 bytes
4665  * which indicates each page of a CBS Message sent to the MS by the
4666  * BTS as coded in 3GPP 23.041 Section 9.4.1.2.
4667  * If received from UMTS network, "data" is const char of 90 up to 1252
4668  * bytes which contain between 1 and 15 CBS Message pages sent as one
4669  * packet to the MS by the BTS as coded in 3GPP 23.041 Section 9.4.2.2.
4670  *
4671  */
4672 #define RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS 1021
4673
4674 /**
4675  * RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL
4676  *
4677  * Indicates that SMS storage on the RUIM is full.  Messages
4678  * cannot be saved on the RUIM until space is freed.
4679  *
4680  * "data" is null
4681  *
4682  */
4683 #define RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL 1022
4684
4685 /**
4686  * RIL_UNSOL_RESTRICTED_STATE_CHANGED
4687  *
4688  * Indicates a restricted state change (eg, for Domain Specific Access Control).
4689  *
4690  * Radio need send this msg after radio off/on cycle no matter it is changed or not.
4691  *
4692  * "data" is an int *
4693  * ((int *)data)[0] contains a bitmask of RIL_RESTRICTED_STATE_* values.
4694  */
4695 #define RIL_UNSOL_RESTRICTED_STATE_CHANGED 1023
4696
4697 /**
4698  * RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE
4699  *
4700  * Indicates that the radio system selection module has
4701  * autonomously entered emergency callback mode.
4702  *
4703  * "data" is null
4704  *
4705  */
4706 #define RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE 1024
4707
4708 /**
4709  * RIL_UNSOL_CDMA_CALL_WAITING
4710  *
4711  * Called when CDMA radio receives a call waiting indication.
4712  *
4713  * "data" is const RIL_CDMA_CallWaiting *
4714  *
4715  */
4716 #define RIL_UNSOL_CDMA_CALL_WAITING 1025
4717
4718 /**
4719  * RIL_UNSOL_CDMA_OTA_PROVISION_STATUS
4720  *
4721  * Called when CDMA radio receives an update of the progress of an
4722  * OTASP/OTAPA call.
4723  *
4724  * "data" is const int *
4725  *  For CDMA this is an integer OTASP/OTAPA status listed in
4726  *  RIL_CDMA_OTA_ProvisionStatus.
4727  *
4728  */
4729 #define RIL_UNSOL_CDMA_OTA_PROVISION_STATUS 1026
4730
4731 /**
4732  * RIL_UNSOL_CDMA_INFO_REC
4733  *
4734  * Called when CDMA radio receives one or more info recs.
4735  *
4736  * "data" is const RIL_CDMA_InformationRecords *
4737  *
4738  */
4739 #define RIL_UNSOL_CDMA_INFO_REC 1027
4740
4741 /**
4742  * RIL_UNSOL_OEM_HOOK_RAW
4743  *
4744  * This is for OEM specific use.
4745  *
4746  * "data" is a byte[]
4747  */
4748 #define RIL_UNSOL_OEM_HOOK_RAW 1028
4749
4750 /**
4751  * RIL_UNSOL_RINGBACK_TONE
4752  *
4753  * Indicates that nework doesn't have in-band information,  need to
4754  * play out-band tone.
4755  *
4756  * "data" is an int *
4757  * ((int *)data)[0] == 0 for stop play ringback tone.
4758  * ((int *)data)[0] == 1 for start play ringback tone.
4759  */
4760 #define RIL_UNSOL_RINGBACK_TONE 1029
4761
4762 /**
4763  * RIL_UNSOL_RESEND_INCALL_MUTE
4764  *
4765  * Indicates that framework/application need reset the uplink mute state.
4766  *
4767  * There may be situations where the mute state becomes out of sync
4768  * between the application and device in some GSM infrastructures.
4769  *
4770  * "data" is null
4771  */
4772 #define RIL_UNSOL_RESEND_INCALL_MUTE 1030
4773
4774 /**
4775  * RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED
4776  *
4777  * Called when CDMA subscription source changed.
4778  *
4779  * "data" is int *
4780  * ((int *)data)[0] is == RIL_CdmaSubscriptionSource
4781  */
4782 #define RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED 1031
4783
4784 /**
4785  * RIL_UNSOL_CDMA_PRL_CHANGED
4786  *
4787  * Called when PRL (preferred roaming list) changes.
4788  *
4789  * "data" is int *
4790  * ((int *)data)[0] is PRL_VERSION as would be returned by RIL_REQUEST_CDMA_SUBSCRIPTION
4791  */
4792 #define RIL_UNSOL_CDMA_PRL_CHANGED 1032
4793
4794 /**
4795  * RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE
4796  *
4797  * Called when Emergency Callback Mode Ends
4798  *
4799  * Indicates that the radio system selection module has
4800  * proactively exited emergency callback mode.
4801  *
4802  * "data" is NULL
4803  *
4804  */
4805 #define RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE 1033
4806
4807 /**
4808  * RIL_UNSOL_RIL_CONNECTED
4809  *
4810  * Called the ril connects and returns the version
4811  *
4812  * "data" is int *
4813  * ((int *)data)[0] is RIL_VERSION
4814  */
4815 #define RIL_UNSOL_RIL_CONNECTED 1034
4816
4817 /**
4818  * RIL_UNSOL_VOICE_RADIO_TECH_CHANGED
4819  *
4820  * Indicates that voice technology has changed. Contains new radio technology
4821  * as a data in the message.
4822  *
4823  * "data" is int *
4824  * ((int *)data)[0] is of type const RIL_RadioTechnology
4825  *
4826  */
4827 #define RIL_UNSOL_VOICE_RADIO_TECH_CHANGED 1035
4828
4829 /**
4830  * RIL_UNSOL_CELL_INFO_LIST
4831  *
4832  * Same information as returned by RIL_REQUEST_GET_CELL_INFO_LIST, but returned
4833  * at the rate no greater than specified by RIL_REQUEST_SET_UNSOL_CELL_INFO_RATE.
4834  *
4835  * "data" is NULL
4836  *
4837  * "response" is an array of RIL_CellInfo.
4838  */
4839 #define RIL_UNSOL_CELL_INFO_LIST 1036
4840
4841 /**
4842  * RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED
4843  *
4844  * Called when IMS registration state has changed
4845  *
4846  * To get IMS registration state and IMS SMS format, callee needs to invoke the
4847  * following request on main thread:
4848  *
4849  * RIL_REQUEST_IMS_REGISTRATION_STATE
4850  *
4851  * "data" is NULL
4852  *
4853  */
4854 #define RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED 1037
4855
4856 /**
4857  * RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED
4858  *
4859  * Indicated when there is a change in subscription status.
4860  * This event will be sent in the following scenarios
4861  *  - subscription readiness at modem, which was selected by telephony layer
4862  *  - when subscription is deactivated by modem due to UICC card removal
4863  *  - When network invalidates the subscription i.e. attach reject due to authentication reject
4864  *
4865  * "data" is const int *
4866  * ((const int *)data)[0] == 0 for Subscription Deactivated
4867  * ((const int *)data)[0] == 1 for Subscription Activated
4868  *
4869  */
4870 #define RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED 1038
4871
4872 /**
4873  * RIL_UNSOL_SRVCC_STATE_NOTIFY
4874  *
4875  * Called when Single Radio Voice Call Continuity(SRVCC)
4876  * progress state has changed
4877  *
4878  * "data" is int *
4879  * ((int *)data)[0] is of type const RIL_SrvccState
4880  *
4881  */
4882
4883 #define RIL_UNSOL_SRVCC_STATE_NOTIFY 1039
4884
4885 /**
4886  * RIL_UNSOL_HARDWARE_CONFIG_CHANGED
4887  *
4888  * Called when the hardware configuration associated with the RILd changes
4889  *
4890  * "data" is an array of RIL_HardwareConfig
4891  *
4892  */
4893 #define RIL_UNSOL_HARDWARE_CONFIG_CHANGED 1040
4894
4895 /**
4896  * RIL_UNSOL_DC_RT_INFO_CHANGED
4897  *
4898  * Sent when the DC_RT_STATE changes but the time
4899  * between these messages must not be less than the
4900  * value set by RIL_REQUEST_SET_DC_RT_RATE.
4901  *
4902  * "data" is the most recent RIL_DcRtInfo
4903  *
4904  */
4905 #define RIL_UNSOL_DC_RT_INFO_CHANGED 1041
4906
4907 /**
4908  * RIL_UNSOL_RADIO_CAPABILITY
4909  *
4910  * Sent when RIL_REQUEST_SET_RADIO_CAPABILITY completes.
4911  * Returns the phone radio capability exactly as
4912  * RIL_REQUEST_GET_RADIO_CAPABILITY and should be the
4913  * same set as sent by RIL_REQUEST_SET_RADIO_CAPABILITY.
4914  *
4915  * "data" is the RIL_RadioCapability structure
4916  */
4917 #define RIL_UNSOL_RADIO_CAPABILITY 1042
4918
4919 /*
4920  * RIL_UNSOL_ON_SS
4921  *
4922  * Called when SS response is received when DIAL/USSD/SS is changed to SS by
4923  * call control.
4924  *
4925  * "data" is const RIL_StkCcUnsolSsResponse *
4926  *
4927  */
4928 #define RIL_UNSOL_ON_SS 1043
4929
4930 /**
4931  * RIL_UNSOL_STK_CC_ALPHA_NOTIFY
4932  *
4933  * Called when there is an ALPHA from UICC during Call Control.
4934  *
4935  * "data" is const char * containing ALPHA string from UICC in UTF-8 format.
4936  *
4937  */
4938 #define RIL_UNSOL_STK_CC_ALPHA_NOTIFY 1044
4939
4940 /***********************************************************************/
4941
4942
4943 #if defined(ANDROID_MULTI_SIM)
4944 /**
4945  * RIL_Request Function pointer
4946  *
4947  * @param request is one of RIL_REQUEST_*
4948  * @param data is pointer to data defined for that RIL_REQUEST_*
4949  *        data is owned by caller, and should not be modified or freed by callee
4950  * @param t should be used in subsequent call to RIL_onResponse
4951  * @param datalen the length of data
4952  *
4953  */
4954 typedef void (*RIL_RequestFunc) (int request, void *data,
4955                                     size_t datalen, RIL_Token t, RIL_SOCKET_ID socket_id);
4956
4957 /**
4958  * This function should return the current radio state synchronously
4959  */
4960 typedef RIL_RadioState (*RIL_RadioStateRequest)(RIL_SOCKET_ID socket_id);
4961
4962 #else
4963 /* Backward compatible */
4964
4965 /**
4966  * RIL_Request Function pointer
4967  *
4968  * @param request is one of RIL_REQUEST_*
4969  * @param data is pointer to data defined for that RIL_REQUEST_*
4970  *        data is owned by caller, and should not be modified or freed by callee
4971  * @param t should be used in subsequent call to RIL_onResponse
4972  * @param datalen the length of data
4973  *
4974  */
4975 typedef void (*RIL_RequestFunc) (int request, void *data,
4976                                     size_t datalen, RIL_Token t);
4977
4978 /**
4979  * This function should return the current radio state synchronously
4980  */
4981 typedef RIL_RadioState (*RIL_RadioStateRequest)();
4982
4983 #endif
4984
4985
4986 /**
4987  * This function returns "1" if the specified RIL_REQUEST code is
4988  * supported and 0 if it is not
4989  *
4990  * @param requestCode is one of RIL_REQUEST codes
4991  */
4992
4993 typedef int (*RIL_Supports)(int requestCode);
4994
4995 /**
4996  * This function is called from a separate thread--not the
4997  * thread that calls RIL_RequestFunc--and indicates that a pending
4998  * request should be cancelled.
4999  *
5000  * On cancel, the callee should do its best to abandon the request and
5001  * call RIL_onRequestComplete with RIL_Errno CANCELLED at some later point.
5002  *
5003  * Subsequent calls to  RIL_onRequestComplete for this request with
5004  * other results will be tolerated but ignored. (That is, it is valid
5005  * to ignore the cancellation request)
5006  *
5007  * RIL_Cancel calls should return immediately, and not wait for cancellation
5008  *
5009  * Please see ITU v.250 5.6.1 for how one might implement this on a TS 27.007
5010  * interface
5011  *
5012  * @param t token wants to be canceled
5013  */
5014
5015 typedef void (*RIL_Cancel)(RIL_Token t);
5016
5017 typedef void (*RIL_TimedCallback) (void *param);
5018
5019 /**
5020  * Return a version string for your RIL implementation
5021  */
5022 typedef const char * (*RIL_GetVersion) (void);
5023
5024 typedef struct {
5025     int version;        /* set to RIL_VERSION */
5026     RIL_RequestFunc onRequest;
5027     RIL_RadioStateRequest onStateRequest;
5028     RIL_Supports supports;
5029     RIL_Cancel onCancel;
5030     RIL_GetVersion getVersion;
5031 } RIL_RadioFunctions;
5032
5033 typedef struct {
5034     char *apn;
5035     char *protocol;
5036     int authtype;
5037     char *username;
5038     char *password;
5039 } RIL_InitialAttachApn;
5040
5041 typedef struct {
5042     int authContext;            /* P2 value of authentication command, see P2 parameter in
5043                                    3GPP TS 31.102 7.1.2 */
5044     char *authData;             /* the challenge string in Base64 format, see 3GPP
5045                                    TS 31.102 7.1.2 */
5046     char *aid;                  /* AID value, See ETSI 102.221 8.1 and 101.220 4,
5047                                    NULL if no value. */
5048 } RIL_SimAuthentication;
5049
5050 #ifdef RIL_SHLIB
5051 struct RIL_Env {
5052     /**
5053      * "t" is parameter passed in on previous call to RIL_Notification
5054      * routine.
5055      *
5056      * If "e" != SUCCESS, then response can be null/is ignored
5057      *
5058      * "response" is owned by caller, and should not be modified or
5059      * freed by callee
5060      *
5061      * RIL_onRequestComplete will return as soon as possible
5062      */
5063     void (*OnRequestComplete)(RIL_Token t, RIL_Errno e,
5064                            void *response, size_t responselen);
5065
5066 #if defined(ANDROID_MULTI_SIM)
5067     /**
5068      * "unsolResponse" is one of RIL_UNSOL_RESPONSE_*
5069      * "data" is pointer to data defined for that RIL_UNSOL_RESPONSE_*
5070      *
5071      * "data" is owned by caller, and should not be modified or freed by callee
5072      */
5073     void (*OnUnsolicitedResponse)(int unsolResponse, const void *data, size_t datalen, RIL_SOCKET_ID socket_id);
5074 #else
5075     /**
5076      * "unsolResponse" is one of RIL_UNSOL_RESPONSE_*
5077      * "data" is pointer to data defined for that RIL_UNSOL_RESPONSE_*
5078      *
5079      * "data" is owned by caller, and should not be modified or freed by callee
5080      */
5081     void (*OnUnsolicitedResponse)(int unsolResponse, const void *data, size_t datalen);
5082 #endif
5083     /**
5084      * Call user-specifed "callback" function on on the same thread that
5085      * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
5086      * a relative time value at which the callback is invoked. If relativeTime is
5087      * NULL or points to a 0-filled structure, the callback will be invoked as
5088      * soon as possible
5089      */
5090
5091     void (*RequestTimedCallback) (RIL_TimedCallback callback,
5092                                    void *param, const struct timeval *relativeTime);
5093 };
5094
5095
5096 /**
5097  *  RIL implementations must defined RIL_Init
5098  *  argc and argv will be command line arguments intended for the RIL implementation
5099  *  Return NULL on error
5100  *
5101  * @param env is environment point defined as RIL_Env
5102  * @param argc number of arguments
5103  * @param argv list fo arguments
5104  *
5105  */
5106 const RIL_RadioFunctions *RIL_Init(const struct RIL_Env *env, int argc, char **argv);
5107
5108 #else /* RIL_SHLIB */
5109
5110 /**
5111  * Call this once at startup to register notification routine
5112  *
5113  * @param callbacks user-specifed callback function
5114  */
5115 void RIL_register (const RIL_RadioFunctions *callbacks);
5116
5117
5118 /**
5119  *
5120  * RIL_onRequestComplete will return as soon as possible
5121  *
5122  * @param t is parameter passed in on previous call to RIL_Notification
5123  *          routine.
5124  * @param e error code
5125  *          if "e" != SUCCESS, then response can be null/is ignored
5126  * @param response is owned by caller, and should not be modified or
5127  *                 freed by callee
5128  * @param responselen the length of response in byte
5129  */
5130 void RIL_onRequestComplete(RIL_Token t, RIL_Errno e,
5131                            void *response, size_t responselen);
5132
5133 #if defined(ANDROID_MULTI_SIM)
5134 /**
5135  * @param unsolResponse is one of RIL_UNSOL_RESPONSE_*
5136  * @param data is pointer to data defined for that RIL_UNSOL_RESPONSE_*
5137  *     "data" is owned by caller, and should not be modified or freed by callee
5138  * @param datalen the length of data in byte
5139  */
5140
5141 void RIL_onUnsolicitedResponse(int unsolResponse, const void *data,
5142                                 size_t datalen, RIL_SOCKET_ID socket_id);
5143 #else
5144 /**
5145  * @param unsolResponse is one of RIL_UNSOL_RESPONSE_*
5146  * @param data is pointer to data defined for that RIL_UNSOL_RESPONSE_*
5147  *     "data" is owned by caller, and should not be modified or freed by callee
5148  * @param datalen the length of data in byte
5149  */
5150
5151 void RIL_onUnsolicitedResponse(int unsolResponse, const void *data,
5152                                 size_t datalen);
5153 #endif
5154
5155 /**
5156  * Call user-specifed "callback" function on on the same thread that
5157  * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies
5158  * a relative time value at which the callback is invoked. If relativeTime is
5159  * NULL or points to a 0-filled structure, the callback will be invoked as
5160  * soon as possible
5161  *
5162  * @param callback user-specifed callback function
5163  * @param param parameter list
5164  * @param relativeTime a relative time value at which the callback is invoked
5165  */
5166
5167 void RIL_requestTimedCallback (RIL_TimedCallback callback,
5168                                void *param, const struct timeval *relativeTime);
5169
5170
5171 #endif /* RIL_SHLIB */
5172
5173 #ifdef __cplusplus
5174 }
5175 #endif
5176
5177 #endif /*ANDROID_RIL_H*/