OSDN Git Service

Add new RadioError in telephony hidl interface.
[android-x86/hardware-interfaces.git] / radio / 1.0 / types.hal
1 /*
2  * Copyright (C) 2016 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 package android.hardware.radio@1.0;
18
19 enum RadioConst : int32_t {
20     CDMA_ALPHA_INFO_BUFFER_LENGTH = 64,
21     CDMA_NUMBER_INFO_BUFFER_LENGTH = 81,
22     MAX_RILDS = 3,
23     MAX_SOCKET_NAME_LENGTH = 6,
24     MAX_CLIENT_ID_LENGTH = 2,
25     MAX_DEBUG_SOCKET_NAME_LENGTH = 12,
26     MAX_QEMU_PIPE_NAME_LENGTH = 11,
27     MAX_UUID_LENGTH = 64,
28     CARD_MAX_APPS = 8,
29     CDMA_MAX_NUMBER_OF_INFO_RECS = 10,
30     SS_INFO_MAX = 4,
31     NUM_SERVICE_CLASSES = 7,
32     NUM_TX_POWER_LEVELS = 5,
33 };
34
35 enum RadioCdmaSmsConst : int32_t {
36     ADDRESS_MAX = 36,
37     SUBADDRESS_MAX = 36,
38     BEARER_DATA_MAX = 255,
39     UDH_MAX_SND_SIZE = 128,
40     UDH_EO_DATA_SEGMENT_MAX = 131,
41     MAX_UD_HEADERS = 7,
42     USER_DATA_MAX = 229,
43     UDH_LARGE_PIC_SIZE = 128,
44     UDH_SMALL_PIC_SIZE = 32,
45     UDH_VAR_PIC_SIZE = 134,
46     UDH_ANIM_NUM_BITMAPS = 4,
47     UDH_LARGE_BITMAP_SIZE = 32,
48     UDH_SMALL_BITMAP_SIZE = 8,
49     UDH_OTHER_SIZE = 226,
50     IP_ADDRESS_SIZE = 4,
51 };
52
53 enum RadioError : int32_t {
54     INVALID_RESPONSE = -1,                // Response from vendor had invalid data
55     NONE = 0,                             // Success
56     RADIO_NOT_AVAILABLE = 1,              // If radio did not start or is resetting
57     GENERIC_FAILURE = 2,
58     PASSWORD_INCORRECT = 3,               // for PIN/PIN2 methods only
59     SIM_PIN2 = 4,                         // Operation requires SIM PIN2 to be entered
60     SIM_PUK2 = 5,                         // Operation requires SIM PIN2 to be entered
61     REQUEST_NOT_SUPPORTED = 6,
62     CANCELLED = 7,
63     OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, // data ops are not allowed during voice
64                                           // call on a Class C GPRS device
65     OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9,  // data ops are not allowed before device
66                                           // registers in network
67     SMS_SEND_FAIL_RETRY = 10,             // fail to send sms and need retry
68     SIM_ABSENT = 11,                      // fail to set the location where CDMA subscription
69                                           // shall be retrieved because of SIM or RUIM
70                                           // card absent
71     SUBSCRIPTION_NOT_AVAILABLE = 12,      // fail to find CDMA subscription from specified
72                                           // location
73     MODE_NOT_SUPPORTED = 13,              // HW does not support preferred network type
74     FDN_CHECK_FAILURE = 14,               // command failed because recipient is not on FDN list
75     ILLEGAL_SIM_OR_ME = 15,               // network selection failed due to illegal SIM or ME
76     MISSING_RESOURCE = 16,                // no logical channel available
77     NO_SUCH_ELEMENT = 17,                 // application not found on SIM
78     DIAL_MODIFIED_TO_USSD = 18,           // DIAL request modified to USSD
79     DIAL_MODIFIED_TO_SS = 19,             // DIAL request modified to SS
80     DIAL_MODIFIED_TO_DIAL = 20,           // DIAL request modified to DIAL with different data
81     USSD_MODIFIED_TO_DIAL = 21,           // USSD request modified to DIAL
82     USSD_MODIFIED_TO_SS = 22,             // USSD request modified to SS
83     USSD_MODIFIED_TO_USSD = 23,           // USSD request modified to different USSD request
84     SS_MODIFIED_TO_DIAL = 24,             // SS request modified to DIAL
85     SS_MODIFIED_TO_USSD = 25,             // SS request modified to USSD
86     SUBSCRIPTION_NOT_SUPPORTED = 26,      // Subscription not supported by RIL
87     SS_MODIFIED_TO_SS = 27,               // SS request modified to different SS request
88     LCE_NOT_SUPPORTED = 36,               // LCE service not supported(36 in RILConstants.java)
89     NO_MEMORY = 37,                       // Not sufficient memory to process the request
90     INTERNAL_ERR = 38,                    // Hit unexpected vendor internal error scenario
91     SYSTEM_ERR = 39,                      // Hit platform or system error
92     MODEM_ERR = 40,                       // Hit unexpected modem error
93     INVALID_STATE = 41,                   // Unexpected request for the current state
94     NO_RESOURCES = 42,                    // Not sufficient resource to process the request
95     SIM_ERR = 43,                         // Received error from SIM card
96     INVALID_ARGUMENTS = 44,               // Received invalid arguments in request
97     INVALID_SIM_STATE = 45,               // Cannot process the request in current SIM state
98     INVALID_MODEM_STATE = 46,             // Cannot process the request in current Modem state
99     INVALID_CALL_ID = 47,                 // Received invalid call id in request
100     NO_SMS_TO_ACK = 48,                   // ACK received when there is no SMS to ack
101     NETWORK_ERR = 49,                     // Received error from network
102     REQUEST_RATE_LIMITED = 50,            // Operation denied due to overly-frequent requests
103     SIM_BUSY = 51,                        // SIM is busy
104     SIM_FULL = 52,                        // The target EF is full
105     NETWORK_REJECT = 53,                  // Request is rejected by network
106     OPERATION_NOT_ALLOWED = 54,           // Not allowed the request now
107     EMPTY_RECORD = 55,                    // The request record is empty
108     INVALID_SMS_FORMAT = 56,              // Invalid sms format
109     ENCODING_ERR = 57,                    // Message not encoded properly
110     INVALID_SMSC_ADDRESS = 58,            // SMSC address specified is invalid
111     NO_SUCH_ENTRY = 59,                   // No such entry present to perform the request
112     NETWORK_NOT_READY = 60,               // Network is not ready to perform the request
113     NOT_PROVISIONED = 61,                 // Device doesnot have this value provisioned
114     NO_SUBSCRIPTION = 62,                 // Device doesnot have subscription
115     NO_NETWORK_FOUND = 63,                // Network cannot be found
116     DEVICE_IN_USE = 64,                   // Operation cannot be performed because the device
117                                           // is currently in use
118     RIL_E_ABORTED = 65,                   // Operation aborted
119
120     // TODO(May be moved to vendor HAL extension)
121     // OEM specific error codes. To be used by OEM when they don't want to reveal
122     // specific error codes which would be replaced by Generic failure.
123     OEM_ERROR_1 = 501,
124     OEM_ERROR_2 = 502,
125     OEM_ERROR_3 = 503,
126     OEM_ERROR_4 = 504,
127     OEM_ERROR_5 = 505,
128     OEM_ERROR_6 = 506,
129     OEM_ERROR_7 = 507,
130     OEM_ERROR_8 = 508,
131     OEM_ERROR_9 = 509,
132     OEM_ERROR_10 = 510,
133     OEM_ERROR_11 = 511,
134     OEM_ERROR_12 = 512,
135     OEM_ERROR_13 = 513,
136     OEM_ERROR_14 = 514,
137     OEM_ERROR_15 = 515,
138     OEM_ERROR_16 = 516,
139     OEM_ERROR_17 = 517,
140     OEM_ERROR_18 = 518,
141     OEM_ERROR_19 = 519,
142     OEM_ERROR_20 = 520,
143     OEM_ERROR_21 = 521,
144     OEM_ERROR_22 = 522,
145     OEM_ERROR_23 = 523,
146     OEM_ERROR_24 = 524,
147     OEM_ERROR_25 = 525,
148 };
149
150 enum RadioResponseType : int32_t {
151     SOLICITED,
152     SOLICITED_ACK,
153     SOLICITED_ACK_EXP,
154 };
155
156 enum RadioIndicationType : int32_t {
157     UNSOLICITED,
158     UNSOLICITED_ACK_EXP,
159 };
160
161 enum RestrictedState : int32_t {
162     NONE = 0x00,
163     CS_EMERGENCY = 0x01,
164     CS_NORMAL = 0x02,
165     CS_ALL = 0x04,
166     PS_ALL = 0x10,
167 };
168
169 enum CardState : int32_t {
170     ABSENT,
171     PRESENT,
172     ERROR,
173     RESTRICTED,                           // card is present but not usable due to carrier
174                                           // restrictions
175 };
176
177 enum PinState : int32_t {
178     UNKNOWN,
179     ENABLED_NOT_VERIFIED,
180     ENABLED_VERIFIED,
181     DISABLED,
182     ENABLED_BLOCKED,
183     ENABLED_PERM_BLOCKED,
184 };
185
186 enum AppType : int32_t {
187     UNKNOWN,
188     SIM,
189     USIM,
190     RUIM,
191     CSIM,
192     ISIM,
193 };
194
195 enum AppState : int32_t {
196     UNKNOWN,
197     DETECTED,
198     PIN,                                  // If PIN1 or UPin is required
199     PUK,                                  // If PUK1 or Puk for UPin is required
200     SUBSCRIPTION_PERSO,                   // perso_substate must be look at when app_state is
201                                           // assigned to this value
202     READY,
203 };
204
205 enum PersoSubstate : int32_t {
206     UNKNOWN,                              // initial state
207     IN_PROGRESS,                          // in between each lock transition
208     READY,                                // when either SIM or RUIM Perso is finished since each
209                                           // app must only have 1 active perso involved
210     SIM_NETWORK,
211     SIM_NETWORK_SUBSET,
212     SIM_CORPORATE,
213     SIM_SERVICE_PROVIDER,
214     SIM_SIM,
215     SIM_NETWORK_PUK,                      // The corresponding perso lock is blocked
216     SIM_NETWORK_SUBSET_PUK,
217     SIM_CORPORATE_PUK,
218     SIM_SERVICE_PROVIDER_PUK,
219     SIM_SIM_PUK,
220     RUIM_NETWORK1,
221     RUIM_NETWORK2,
222     RUIM_HRPD,
223     RUIM_CORPORATE,
224     RUIM_SERVICE_PROVIDER,
225     RUIM_RUIM,
226     RUIM_NETWORK1_PUK,                   // The corresponding perso lock is blocked
227     RUIM_NETWORK2_PUK,
228     RUIM_HRPD_PUK,
229     RUIM_CORPORATE_PUK,
230     RUIM_SERVICE_PROVIDER_PUK,
231     RUIM_RUIM_PUK,
232 };
233
234 enum RadioState : int32_t {
235     OFF = 0,                              // Radio explictly powered off (eg CFUN=0)
236     UNAVAILABLE = 1,                      // Radio unavailable (eg, resetting or not booted)
237     ON = 10,                              // Radio is ON
238 };
239
240 enum SapConnectRsp : int32_t {
241     SUCCESS,
242     CONNECT_FAILURE,
243     MSG_SIZE_TOO_LARGE,
244     MSG_SIZE_TOO_SMALL,
245     CONNECT_OK_CALL_ONGOING
246 };
247
248 enum SapDisconnectType : int32_t {
249     GRACEFUL,
250     IMMEDIATE
251 };
252
253 enum SapApduType : int32_t {
254     APDU,
255     APDU7816
256 };
257
258 enum SapResultCode : int32_t {
259     SUCCESS,
260     GENERIC_FAILURE,
261     CARD_NOT_ACCESSSIBLE,
262     CARD_ALREADY_POWERED_OFF,
263     CARD_REMOVED,
264     CARD_ALREADY_POWERED_ON,
265     DATA_NOT_AVAILABLE,
266     NOT_SUPPORTED
267 };
268
269 enum SapStatus : int32_t {
270     UNKNOWN_ERROR,
271     CARD_RESET,
272     CARD_NOT_ACCESSIBLE,
273     CARD_REMOVED,
274     CARD_INSERTED,
275     RECOVERED
276 };
277
278 enum SapTransferProtocol : int32_t {
279     T0,
280     T1
281 };
282
283 enum CallState : int32_t {
284     ACTIVE,
285     HOLDING,
286     DIALING,                             // MO call only
287     ALERTING,                            // MO call only
288     INCOMING,                            // MT call only
289     WAITING,                             // MT call only
290 };
291
292 /*
293  * User-to-User signaling Info activation types derived from 3GPP 23.087 v8.0
294  */
295 enum UusType : int32_t {
296     TYPE1_IMPLICIT,
297     TYPE1_REQUIRED,
298     TYPE1_NOT_REQUIRED,
299     TYPE2_REQUIRED,
300     TYPE2_NOT_REQUIRED,
301     TYPE3_REQUIRED,
302     TYPE3_NOT_REQUIRED,
303 };
304
305 /*
306  * User-to-User Signaling Information data coding schemes. Possible values for
307  * Octet 3 (Protocol Discriminator field) in the UUIE. The values have been
308  * specified in section 10.5.4.25 of 3GPP TS 24.008
309  */
310 enum UusDcs : int32_t {
311     USP,                                  // User specified protocol
312     OSIHLP,                               // OSI higher layer protocol
313     X244,                                 // X.244
314     RMCF,                                 // Reserved for system mangement convergence function
315     IA5C,                                 // IA5 characters
316 };
317
318 enum CallPresentation : int32_t {
319     ALLOWED,
320     RESTRICTED,
321     UNKNOWN,
322     PAYPHONE,
323 };
324
325 enum Clir : int32_t {
326     DEFAULT,                               // "use subscription default value"
327     INVOCATION,                            // restrict CLI presentation
328     SUPPRESSION,                           // allow CLI presentation
329 };
330
331 enum LastCallFailCause : int32_t {
332     UNOBTAINABLE_NUMBER = 1,
333     NO_ROUTE_TO_DESTINATION = 3,
334     CHANNEL_UNACCEPTABLE = 6,
335     OPERATOR_DETERMINED_BARRING = 8,
336     NORMAL = 16,
337     BUSY = 17,
338     NO_USER_RESPONDING = 18,
339     NO_ANSWER_FROM_USER = 19,
340     CALL_REJECTED = 21,
341     NUMBER_CHANGED = 22,
342     PREEMPTION = 25,
343     DESTINATION_OUT_OF_ORDER = 27,
344     INVALID_NUMBER_FORMAT = 28,
345     FACILITY_REJECTED = 29,
346     RESP_TO_STATUS_ENQUIRY = 30,
347     NORMAL_UNSPECIFIED = 31,
348     CONGESTION = 34,
349     NETWORK_OUT_OF_ORDER = 38,
350     TEMPORARY_FAILURE = 41,
351     SWITCHING_EQUIPMENT_CONGESTION = 42,
352     ACCESS_INFORMATION_DISCARDED = 43,
353     REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE = 44,
354     RESOURCES_UNAVAILABLE_OR_UNSPECIFIED = 47,
355     QOS_UNAVAILABLE = 49,
356     REQUESTED_FACILITY_NOT_SUBSCRIBED = 50,
357     INCOMING_CALLS_BARRED_WITHIN_CUG = 55,
358     BEARER_CAPABILITY_NOT_AUTHORIZED = 57,
359     BEARER_CAPABILITY_UNAVAILABLE = 58,
360     SERVICE_OPTION_NOT_AVAILABLE = 63,
361     BEARER_SERVICE_NOT_IMPLEMENTED = 65,
362     ACM_LIMIT_EXCEEDED = 68,
363     REQUESTED_FACILITY_NOT_IMPLEMENTED = 69,
364     ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE = 70,
365     SERVICE_OR_OPTION_NOT_IMPLEMENTED = 79,
366     INVALID_TRANSACTION_IDENTIFIER = 81,
367     USER_NOT_MEMBER_OF_CUG = 87,
368     INCOMPATIBLE_DESTINATION = 88,
369     INVALID_TRANSIT_NW_SELECTION = 91,
370     SEMANTICALLY_INCORRECT_MESSAGE = 95,
371     INVALID_MANDATORY_INFORMATION = 96,
372     MESSAGE_TYPE_NON_IMPLEMENTED = 97,
373     MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98,
374     INFORMATION_ELEMENT_NON_EXISTENT = 99,
375     CONDITIONAL_IE_ERROR = 100,
376     MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101,
377     RECOVERY_ON_TIMER_EXPIRED = 102,
378     PROTOCOL_ERROR_UNSPECIFIED = 111,
379     INTERWORKING_UNSPECIFIED = 127,
380     CALL_BARRED = 240,
381     FDN_BLOCKED = 241,
382     IMSI_UNKNOWN_IN_VLR = 242,
383     IMEI_NOT_ACCEPTED = 243,
384     DIAL_MODIFIED_TO_USSD = 244,          // STK Call Control
385     DIAL_MODIFIED_TO_SS = 245,
386     DIAL_MODIFIED_TO_DIAL = 246,
387     CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000,
388     CDMA_DROP = 1001,
389     CDMA_INTERCEPT = 1002,
390     CDMA_REORDER = 1003,
391     CDMA_SO_REJECT = 1004,
392     CDMA_RETRY_ORDER = 1005,
393     CDMA_ACCESS_FAILURE = 1006,
394     CDMA_PREEMPTED = 1007,
395     CDMA_NOT_EMERGENCY = 1008,            // For non-emergency number dialed during emergency
396                                           // callback mode
397     CDMA_ACCESS_BLOCKED = 1009,           // This error will be deprecated soon,
398                                           // vendor code must make sure to map error
399                                           // code to specific error
400     ERROR_UNSPECIFIED = 0xffff,
401 };
402
403 enum DataCallFailCause : int32_t {
404     NONE = 0,                             // an integer cause code defined in TS 24.008
405                                           // section 6.1.3.1.3 or TS 24.301 Release 8+ Annex B.
406                                           // If the implementation does not have access to the exact
407                                           // cause codes, then it must return one of the
408                                           // following values, as the UI layer needs to distinguish
409                                           // these cases for error notification and potential
410                                           // retries.
411     OPERATOR_BARRED = 0x08,               // no retry
412     NAS_SIGNALLING = 0x0E,                // PDP_FAIL_LLC_SNDCP = 0x19,
413     INSUFFICIENT_RESOURCES = 0x1A,
414     MISSING_UKNOWN_APN = 0x1B,            // no retry
415     UNKNOWN_PDP_ADDRESS_TYPE = 0x1C,      // no retry
416     USER_AUTHENTICATION = 0x1D,           // no retry
417     ACTIVATION_REJECT_GGSN = 0x1E,        // no retry
418     ACTIVATION_REJECT_UNSPECIFIED = 0x1F,
419     SERVICE_OPTION_NOT_SUPPORTED = 0x20,  // no retry
420     SERVICE_OPTION_NOT_SUBSCRIBED = 0x21, // no retry
421     SERVICE_OPTION_OUT_OF_ORDER = 0x22,
422     NSAPI_IN_USE = 0x23,                  // no retry
423     REGULAR_DEACTIVATION = 0x24,          // possibly restart radio,
424                                           // based on framework config
425     QOS_NOT_ACCEPTED = 0x25,
426     NETWORK_FAILURE = 0x26,
427     UMTS_REACTIVATION_REQ = 0x27,
428     FEATURE_NOT_SUPP = 0x28,
429     TFT_SEMANTIC_ERROR = 0x29,
430     TFT_SYTAX_ERROR = 0x2A,
431     UNKNOWN_PDP_CONTEXT = 0x2B,
432     FILTER_SEMANTIC_ERROR = 0x2C,
433     FILTER_SYTAX_ERROR = 0x2D,
434     PDP_WITHOUT_ACTIVE_TFT = 0x2E,
435     ONLY_IPV4_ALLOWED = 0x32,             // no retry
436     ONLY_IPV6_ALLOWED = 0x33,             // no retry
437     ONLY_SINGLE_BEARER_ALLOWED = 0x34,
438     ESM_INFO_NOT_RECEIVED = 0x35,
439     PDN_CONN_DOES_NOT_EXIST = 0x36,
440     MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED = 0x37,
441     MAX_ACTIVE_PDP_CONTEXT_REACHED = 0x41,
442     UNSUPPORTED_APN_IN_CURRENT_PLMN = 0x42,
443     INVALID_TRANSACTION_ID = 0x51,
444     MESSAGE_INCORRECT_SEMANTIC = 0x5F,
445     INVALID_MANDATORY_INFO = 0x60,
446     MESSAGE_TYPE_UNSUPPORTED = 0x61,
447     MSG_TYPE_NONCOMPATIBLE_STATE = 0x62,
448     UNKNOWN_INFO_ELEMENT = 0x63,
449     CONDITIONAL_IE_ERROR = 0x64,
450     MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE = 0x65,
451     PROTOCOL_ERRORS = 0x6F,               // no retry
452     APN_TYPE_CONFLICT = 0x70,
453     INVALID_PCSCF_ADDR = 0x71,
454     INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN = 0x72,
455     EMM_ACCESS_BARRED = 0x73,
456     EMERGENCY_IFACE_ONLY = 0x74,
457     IFACE_MISMATCH = 0x75,
458     COMPANION_IFACE_IN_USE = 0x76,
459     IP_ADDRESS_MISMATCH = 0x77,
460     IFACE_AND_POL_FAMILY_MISMATCH = 0x78,
461     EMM_ACCESS_BARRED_INFINITE_RETRY = 0x79,
462     AUTH_FAILURE_ON_EMERGENCY_CALL = 0x7A,
463     OEM_DCFAILCAUSE_1 = 0x1001,
464
465     // OEM specific error codes. To be used by OEMs when they don't want to
466     // reveal error code which would be replaced by PDP_FAIL_ERROR_UNSPECIFIED
467     // TODO(May be moved to vendor HAL extension)
468     OEM_DCFAILCAUSE_2 = 0x1002,
469     OEM_DCFAILCAUSE_3 = 0x1003,
470     OEM_DCFAILCAUSE_4 = 0x1004,
471     OEM_DCFAILCAUSE_5 = 0x1005,
472     OEM_DCFAILCAUSE_6 = 0x1006,
473     OEM_DCFAILCAUSE_7 = 0x1007,
474     OEM_DCFAILCAUSE_8 = 0x1008,
475     OEM_DCFAILCAUSE_9 = 0x1009,
476     OEM_DCFAILCAUSE_10 = 0x100A,
477     OEM_DCFAILCAUSE_11 = 0x100B,
478     OEM_DCFAILCAUSE_12 = 0x100C,
479     OEM_DCFAILCAUSE_13 = 0x100D,
480     OEM_DCFAILCAUSE_14 = 0x100E,
481     OEM_DCFAILCAUSE_15 = 0x100F,
482
483     // Not mentioned in the specification
484     VOICE_REGISTRATION_FAIL = -1,
485     DATA_REGISTRATION_FAIL = -2,
486
487     // reasons for data call drop - network/modem disconnect
488     SIGNAL_LOST = -3,
489     PREF_RADIO_TECH_CHANGED = -4,         // preferred technology has changed, must retry
490                                           // with parameters appropriate for new technology
491     RADIO_POWER_OFF = -5,                 // data call was disconnected because radio was resetting,
492                                           // powered off - no retry
493     TETHERED_CALL_ACTIVE = -6,            // data call was disconnected by modem because tethered
494                                           // mode was up on same APN/data profile - no retry until
495                                           // tethered call is off
496     ERROR_UNSPECIFIED = 0xffff,
497 };
498
499 /*
500  * Please note that registration state UNKNOWN is
501  * treated as "out of service" in the Android telephony.
502  * Registration state REG_DENIED must be returned if Location Update
503  * Reject (with cause 17 - Network Failure) is received
504  * repeatedly from the network, to facilitate
505  * "managed roaming"
506  */
507 enum RegState : int32_t {
508     NOT_REG_MT_NOT_SEARCHING_OP,          // Not registered, MT is not currently searching
509                                           // a new operator to register
510     REG_HOME,                             // Registered, home network
511     NOT_REG_MT_SEARCHING_OP,              // Not registered, but MT is currently searching
512                                           // a new operator to register
513     REG_DENIED,                           // Registration denied
514     UNKNOWN,                              // Unknown
515     REG_ROAMING,                          // Registered, roaming
516     NOT_REG_MT_NOT_SEARCHING_OP_EM,       // Same as NOT_REG_MT_NOT_SEARCHING_OP but indicates that
517                                           // emergency calls are enabled.
518     NOT_REG_MT_SEARCHING_OP_EM,           // Same as NOT_REG_MT_SEARCHING_OP but indicates that
519                                           // emergency calls are enabled.
520     REG_DENIED_EM,                        // Same as REG_DENIED but indicates that
521                                           // emergency calls are enabled.
522     UNKNOWN_EM                            // Same as UNKNOWN but indicates that
523                                           // emergency calls are enabled.
524 };
525
526 enum RadioTechnology : int32_t {
527     UNKNOWN = 0,
528     GPRS = 1,
529     EDGE = 2,
530     UMTS = 3,
531     IS95A = 4,
532     IS95B = 5,
533     ONE_X_RTT = 6,
534     EVDO_0 = 7,
535     EVDO_A = 8,
536     HSDPA = 9,
537     HSUPA = 10,
538     HSPA = 11,
539     EVDO_B = 12,
540     EHRPD = 13,
541     LTE = 14,
542     HSPAP = 15,                            // HSPA+
543     GSM = 16,                              // Only supports voice
544     TD_SCDMA = 17,
545     IWLAN = 18,
546     LTE_CA = 19,
547 };
548
549 enum DataProfile : int32_t {
550     DEFAULT = 0,
551     TETHERED = 1,
552     IMS = 2,
553     FOTA = 3,
554     CBS = 4,
555     OEM_BASE = 1000,                      // Start of OEM-specific profiles
556     INVALID = 0xFFFFFFFF,
557 };
558
559 enum SmsAcknowledgeFailCause : int32_t {
560     MEMORY_CAPAPCITY_EXCEEDED = 0xD3,
561     UNSPECIFIED_ERROR = 0XFF,
562 };
563
564 enum CallForwardInfoStatus : int32_t {
565     ACTIVE,
566     INACTIVE,
567     DISABLE,
568     ENABLE,
569     INTERROGATE,
570     REGISTRATION,
571     ERASURE,
572 };
573
574 enum ClipStatus : int32_t {
575     CLIP_PROVISIONED,                     // CLIP provisioned
576     CLIP_UNPROVISIONED,                   // CLIP not provisioned
577     UNKOWN,                               // unknown, e.g. no network etc
578 };
579
580 enum SmsWriteArgsStatus : int32_t {
581     REC_UNREAD,
582     REC_READ,
583     STO_UNSENT,
584     STO_SENT,
585 };
586
587 enum RadioBandMode : int32_t  {
588     BAND_MODE_UNSPECIFIED,                // "unspecified" (selected by baseband automatically)
589     BAND_MODE_EURO,                       // "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
590     BAND_MODE_USA,                        // "US band"
591                                           // (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
592     BAND_MODE_JPN,                        // "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
593     BAND_MODE_AUS,                        // "AUS band"
594                                           // (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
595     BAND_MODE_AUS_2,                      // "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
596     BAND_MODE_CELL_800,                   // "Cellular" (800-MHz Band)
597     BAND_MODE_PCS,                        // "PCS" (1900-MHz Band)
598     BAND_MODE_JTACS,                      // "Band Class 3" (JTACS Band)
599     BAND_MODE_KOREA_PCS,                  // "Band Class 4" (Korean PCS Band)
600     BAND_MODE_5_450M,                     // "Band Class 5" (450-MHz Band)
601     BAND_MODE_IMT2000,                    // "Band Class 6" (2-GMHz IMT2000 Band)
602     BAND_MODE_7_700M_2,                   // "Band Class 7" (Upper 700-MHz Band)
603     BAND_MODE_8_1800M,                    // "Band Class 8" (1800-MHz Band)
604     BAND_MODE_9_900M,                     // "Band Class 9" (900-MHz Band)
605     BAND_MODE_10_800M_2,                  // "Band Class 10" (Secondary 800-MHz Band)
606     BAND_MODE_EURO_PAMR_400M,             // "Band Class 11" (400-MHz European PAMR Band)
607     BAND_MODE_AWS,                        // "Band Class 15" (AWS Band)
608     BAND_MODE_USA_2500M,                  // "Band Class 16" (US 2.5-GHz Band)
609 };
610
611 enum OperatorStatus : int32_t {
612     UNKNOWN,
613     AVAILABLE,
614     CURRENT,
615     FORBIDDEN,
616 };
617
618 enum PreferredNetworkType : int32_t {
619     GSM_WCDMA,                            // GSM/WCDMA (WCDMA preferred)
620     GSM_ONLY,                             // GSM only
621     WCDMA,                                // WCDMA
622     GSM_WCDMA_AUTO,                       // GSM/WCDMA (auto mode, according to PRL)
623     CDMA_EVDO_AUTO,                       // CDMA and EvDo (auto mode, according to PRL)
624     CDMA_ONLY,                            // CDMA only
625     EVDO_ONLY,                            // EvDo only
626     GSM_WCDMA_CDMA_EVDO_AUTO,             // GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL)
627     LTE_CDMA_EVDO,                        // LTE, CDMA and EvDo
628     LTE_GSM_WCDMA,                        // LTE, GSM/WCDMA
629     LTE_CMDA_EVDO_GSM_WCDMA,              // LTE, CDMA, EvDo, GSM/WCDMA
630     LTE_ONLY,                             // LTE only
631     LTE_WCDMA,                            // LTE/WCDMA
632     TD_SCDMA_ONLY,                        // TD-SCDMA only
633     TD_SCDMA_WCDMA,                       // TD-SCDMA and WCDMA
634     TD_SCDMA_LTE,                         // TD-SCDMA and LTE
635     TD_SCDMA_GSM,                         // TD-SCDMA and GSM
636     TD_SCDMA_GSM_LTE,                     // TD-SCDMA,GSM and LTE
637     TD_SCDMA_GSM_WCDMA,                   // TD-SCDMA, GSM/WCDMA
638     TD_SCDMA_WCDMA_LTE,                   // TD-SCDMA, WCDMA and LTE
639     TD_SCDMA_GSM_WCDMA_LTE,               // TD-SCDMA, GSM/WCDMA and LTE
640     TD_SCDMA_GSM_WCDMA_CDMA_EVDO_AUTO,    // TD-SCDMA, GSM/WCDMA, CDMA and EvDo
641     TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA,     // TD-SCDMA, LTE, CDMA, EvDo GSM/WCDMA
642 };
643
644 enum CdmaSubscriptionSource : int32_t {
645     RUIM_SIM,
646     NV,
647 };
648
649 enum CdmaRoamingType : int32_t {
650     HOME_NETWORK,
651     AFFILIATED_ROAM,
652     ANY_ROAM,
653 };
654
655 enum TtyMode : int32_t {
656     OFF,
657     FULL,
658     HCO,                                  // Hearing carryover
659     VCO,                                  // Voice carryover
660 };
661
662 enum NvItem : int32_t {
663     // CDMA radio and account information (items 1-10)
664     CDMA_MEID = 1,                       // CDMA MEID (hex)
665     CDMA_MIN = 2,                        // CDMA MIN (MSID)
666     CDMA_MDN = 3,                        // CDMA MDN
667     CDMA_ACCOLC = 4,                     // CDMA access overload control
668
669     // Carrier device provisioning (items 11-30)
670     DEVICE_MSL = 11,                     // device MSL
671     RTN_RECONDITIONED_STATUS = 12,       // RTN reconditioned status
672     RTN_ACTIVATION_DATE = 13,            // RTN activation date
673     RTN_LIFE_TIMER = 14,                 // RTN life timer
674     RTN_LIFE_CALLS = 15,                 // RTN life calls
675     RTN_LIFE_DATA_TX = 16,               // RTN life data TX
676     RTN_LIFE_DATA_RX = 17,               // RTN life data RX
677     OMADM_HFA_LEVEL = 18,                // HFA in progress
678
679     // Mobile IP profile information (items 31-50)
680     MIP_PROFILE_NAI = 31,                // NAI realm
681     MIP_PROFILE_HOME_ADDRESS = 32,       // MIP home address
682     MIP_PROFILE_AAA_AUTH = 33,           // AAA auth
683     MIP_PROFILE_HA_AUTH = 34,            // HA auth
684     MIP_PROFILE_PRI_HA_ADDR = 35,        // primary HA address
685     MIP_PROFILE_SEC_HA_ADDR = 36,        // secondary HA address
686     MIP_PROFILE_REV_TUN_PREF = 37,       // reverse TUN preference
687     MIP_PROFILE_HA_SPI = 38,             // HA SPI
688     MIP_PROFILE_AAA_SPI = 39,            // AAA SPI
689     MIP_PROFILE_MN_HA_SS = 40,           // HA shared secret
690     MIP_PROFILE_MN_AAA_SS = 41,          // AAA shared secret
691
692     // CDMA network and band config (items 51-70)
693     CDMA_PRL_VERSION = 51,               // CDMA PRL version
694     CDMA_BC10 = 52,                      // CDMA band class 10
695     CDMA_BC14 = 53,                      // CDMA band class 14
696     CDMA_SO68 = 54,                      // CDMA SO68
697     CDMA_SO73_COP0 = 55,                 // CDMA SO73 COP0
698     CDMA_SO73_COP1TO7 = 56,              // CDMA SO73 COP1-7
699     CDMA_1X_ADVANCED_ENABLED = 57,       // CDMA 1X Advanced enabled
700     CDMA_EHRPD_ENABLED = 58,             // CDMA eHRPD enabled
701     CDMA_EHRPD_FORCED = 59,              // CDMA eHRPD forced
702
703     // LTE network and band config (items 71-90)
704     LTE_BAND_ENABLE_25 = 71,             // LTE band 25 enable
705     LTE_BAND_ENABLE_26 = 72,             // LTE band 26 enable
706     LTE_BAND_ENABLE_41 = 73,             // LTE band 41 enable
707
708     LTE_SCAN_PRIORITY_25 = 74,           // LTE band 25 scan priority
709     LTE_SCAN_PRIORITY_26 = 75,           // LTE band 26 scan priority
710     LTE_SCAN_PRIORITY_41 = 76,           // LTE band 41 scan priority
711
712     LTE_HIDDEN_BAND_PRIORITY_25 = 77,    // LTE hidden band 25 priority
713     LTE_HIDDEN_BAND_PRIORITY_26 = 78,    // LTE hidden band 26 priority
714     LTE_HIDDEN_BAND_PRIORITY_41 = 79,    // LTE hidden band 41 priority
715 };
716
717 enum ResetNvType : int32_t {
718     RELOAD,                              // reload all NV items
719     ERASE,                               // erase NV reset (SCRTN)
720     FACORY_RESET,                        // factory reset (RTN)
721 };
722
723 enum HardwareConfigType : int32_t {
724     MODEM,
725     SIM,
726 };
727
728 enum HardwareConfigState : int32_t {
729     ENABLED,
730     STANDBY,
731     DISABLED,
732 };
733
734 enum LceStatus : int32_t {
735     NOT_SUPPORTED,
736     STOPPED,
737     ACTIVE
738 };
739
740 enum CarrierMatchType : int32_t {
741     ALL = 0,                               // Apply to all carriers with the same mcc/mnc
742     SPN = 1,                               // Use SPN and mcc/mnc to identify the carrier
743     IMSI_PREFIX = 2,                       // Use IMSI prefix and mcc/mnc to identify the carrier
744     GID1 = 3,                              // Use GID1 and mcc/mnc to identify the carrier
745     GID2 = 4,                              // Use GID2 and mcc/mnc to identify the carrier
746 };
747
748 struct NeighboringCell {
749     string cid;                           // Combination of LAC and Cell Id in 32 bits in GSM.
750                                           // Upper 16 bits is LAC and lower 16 bits
751                                           // is CID (as described in TS 27.005)
752                                           // Primary Scrambling Code (as described in TS 25.331)
753                                           // in 9 bits in UMTS
754                                           // Valid values are hexadecimal 0x0000 - 0xffffffff.
755     int32_t rssi;                         // Received RSSI in GSM,
756                                           // Level index of CPICH Received Signal Code Power in UMTS
757 };
758
759 enum CdmaSmsDigitMode : int32_t {
760     FOUR_BIT,                             // DTMF digits
761     EIGHT_BIT,
762 };
763
764 enum CdmaSmsNumberMode : int32_t {
765     NOT_DATA_NETWORK,
766     DATA_NETWORK,
767 };
768
769 enum CdmaSmsNumberType : int32_t {
770     UNKNOWN,
771     INTERNATIONAL_OR_DATA_IP,             // INTERNATIONAL is used when number mode is not data
772                                           // network
773                                           // address. DATA_IP is used when the number mode is data
774                                           // network address
775     NATIONAL_OR_INTERNET_MAIL,            // NATIONAL is used when the number mode is not data
776                                           // network address. INTERNET_MAIL is used when the number
777                                           // mode is data network address. For INTERNET_MAIL, in
778                                           // the address data "digits", each byte contains an ASCII
779                                           // character.
780                                           // Examples are "x@y.com,a@b.com - ref
781                                           // TIA/EIA-637A 3.4.3.3
782     NETWORK,
783     SUBSCRIBER,
784     ALPHANUMERIC,                         // GSM SMS: address value is GSM 7-bit chars
785     ABBREVIATED,
786     RESERVED_7,
787 };
788
789 enum CdmaSmsNumberPlan : int32_t {
790     UNKNOWN,
791     TELEPHONY,                            // CCITT E.164 and E.163, including ISDN plan
792     RESERVED_2,
793     DATA,                                 // CCITT X.121
794     TELEX,                                // CCITT F.69
795     RESERVED_5,
796     RESERVED_6,
797     RESERVED_7,
798     RESERVED_8,
799     PRIVATE,
800     RESERVED_10,
801     RESERVED_11,
802     RESERVED_12,
803     RESERVED_13,
804     RESERVED_14,
805     RESERVED_15,
806 };
807
808 enum CdmaSmsSubaddressType : int32_t {
809     NSAP,                                // CCITT X.213 or ISO 8348 AD2
810     USER_SPECIFIED,                      // e.g. X.25
811 };
812
813 enum CdmaSmsErrorClass : int32_t {
814     NO_ERROR,
815     ERROR,
816 };
817
818 enum CdmaSmsWriteArgsStatus : int32_t {
819     REC_UNREAD,
820     REC_READ,
821     STO_UNSENT,
822     STO_SENT
823 };
824
825 enum CellInfoType : int32_t {
826     GSM,
827     CDMA,
828     LTE,
829     WCDMA,
830     TD_SCDMA
831 };
832
833 enum TimeStampType : int32_t {
834     UNKNOWN,
835     ANTENNA,
836     MODEM,
837     OEM_RIL,
838     JAVA_RIL,
839 };
840
841 enum ApnAuthType : int32_t {
842     NO_PAP_NO_CHAP,                       // PAP and CHAP is never performed.
843     PAP_NO_CHAP,                          // PAP may be performed; CHAP is never performed.
844     NO_PAP_CHAP,                          // CHAP may be performed; PAP is never performed.
845     PAP_CHAP                              // PAP / CHAP may be performed - baseband dependent.
846 };
847
848 enum RadioTechnologyFamily : int32_t {
849     THREE_GPP,                            // 3GPP Technologies - GSM, WCDMA
850     THREE_GPP2                            // 3GPP2 Technologies - CDMA
851 };
852
853 enum RadioCapabilityPhase : int32_t {
854     CONFIGURED = 0,                      // Logical Modem's (LM)  initial value
855                                          // and value after FINISH completes
856     START      = 1,                      // START is sent before APPLY and indicates that an
857                                          // APPLY is forthcoming with these same parameters
858     APPLY      = 2,                      // APPLY is sent after all LM's receive START and returned
859                                          // RadioCapability.status = 0. If any START's fail, hal
860                                          // implementation must not send APPLY.
861     UNSOL_RSP  = 3,                      // UNSOL_RSP is sent with unsol radioCapability()
862     FINISH     = 4                       // FINISH is sent after all commands have completed. If an
863                                          // error occurs in any previous command, the
864                                          // RadioAccessesFamily and logicalModemUuid fields must be
865                                          // the prior configuration thus restoring the configuration
866                                          // to the previous value. An error returned by FINISH
867                                          // will generally be ignored or may cause that logical
868                                          // modem to be removed from service.
869 };
870
871 enum RadioCapabilityStatus : int32_t {
872     NONE       = 0,                      // This parameter has no meaning with
873                                          // RadioCapabilityPhase:START, RadioCapabilityPhase:APPLY
874     SUCCESS    = 1,                      // Tell modem the action transaction of set radio
875                                          // capability was success with RadioCapabilityPhase:FINISH
876     FAIL       = 2,                      // Tell modem the action transaction of set radio
877                                          // capability is fail with RadioCapabilityPhase:FINISH.
878 };
879
880 enum RadioAccessFamily : int32_t {
881     UNKNOWN = 1 << RadioTechnology:UNKNOWN,
882     GPRS = 1 << RadioTechnology:GPRS,
883     EDGE = 1 << RadioTechnology:EDGE,
884     UMTS = 1 << RadioTechnology:UMTS,
885     IS95A = 1 << RadioTechnology:IS95A,
886     IS95B = 1 << RadioTechnology:IS95B,
887     ONE_X_RTT = 1 << RadioTechnology:ONE_X_RTT,
888     EVDO_0 = 1 << RadioTechnology:EVDO_0,
889     EVDO_A = 1 << RadioTechnology:EVDO_A,
890     HSDPA = 1 << RadioTechnology:HSDPA,
891     HSUPA = 1 << RadioTechnology:HSUPA,
892     HSPA = 1 << RadioTechnology:HSPA,
893     EVDO_B = 1 << RadioTechnology:EVDO_B,
894     EHRPD = 1 << RadioTechnology:EHRPD,
895     LTE = 1 << RadioTechnology:LTE,
896     HSPAP = 1 << RadioTechnology:HSPAP,
897     GSM = 1 << RadioTechnology:GSM,
898     TD_SCDMA = 1 << RadioTechnology:TD_SCDMA,
899     LTE_CA = 1 << RadioTechnology:LTE_CA
900 };
901
902 enum UssdModeType : int32_t {
903     NOTIFY,                                // USSD-Notify
904     REQUEST,                               // USSD-Request
905     NW_RELEASE,                            // Session terminated by network
906     LOCAL_CLIENT,                          // other local client (eg, SIM Toolkit) has responded
907     NOT_SUPPORTED,                         // Operation not supported
908     NW_TIMEOUT,                            // Network timeout
909 };
910
911 enum SimRefreshType : int32_t {
912     SIM_FILE_UPDATE = 0,                   // A file on SIM has been updated.
913     SIM_INIT = 1,                          // SIM initialized. All files should be re-read.
914     SIM_RESET = 2                          // SIM reset. SIM power required, SIM may be locked a
915                                            // nd all files must be re-read.
916 };
917
918 enum SrvccState :int32_t {
919     HANDOVER_STARTED = 0,
920     HANDOVER_COMPLETED = 1,
921     HANDOVER_FAILED = 2,
922     HANDOVER_CANCELED = 3
923 };
924
925 enum UiccSubActStatus : int32_t {
926     DEACTIVATE,
927     ACTIVATE
928 };
929
930 enum SubscriptionType : int32_t {
931     SUBSCRIPTION_1,
932     SUBSCRIPTION_2,
933     SUBSCRIPTION_3
934 };
935
936 enum DataProfileInfoType : int32_t {
937     COMMON,
938     THREE_GPP,
939     THREE_GPP2
940 };
941
942 enum PhoneRestrictedState : int32_t {
943     NONE = 0x00,                           // No restriction at all including voice/SMS/USSD/SS/AV64
944                                            // and packet data
945     CS_EMERGENCY = 0x01,                   // Block emergency call due to restriction. But allow all
946                                            // normal voice/SMS/USSD/SS/AV64.
947     CS_NORMAL = 0x02,                      // Block all normal voice/SMS/USSD/SS/AV64 due to
948                                            // restriction. Only Emergency call allowed.
949     CS_ALL = 0x04,                         // Block all voice/SMS/USSD/SS/AV64 including emergency
950                                            // call due to restriction.
951     PS_ALL = 0x10                          // Block packet data access due to restriction.
952 };
953
954 enum CdmaCallWaitingNumberPresentation : int32_t {
955     ALLOWED = 0,
956     RESTRICTED = 1,
957     UNKNOWN = 2,
958 };
959
960 enum CdmaCallWaitingNumberType : int32_t {
961     UNKNOWN = 0,
962     INTERNATIONAL = 1,
963     NATIONAL = 2,
964     NETWORK_SPECIFIC = 3,
965     SUBSCRIBER = 4
966 };
967
968 enum CdmaCallWaitingNumberPlan : int32_t {
969     UNKNOWN = 0,
970     ISDN = 1,
971     DATA = 3,
972     TELEX = 4,
973     NATIONAL = 8,
974     PRIVATE = 9
975 };
976
977 enum CdmaOtaProvisionStatus : int32_t {
978     SPL_UNLOCKED,
979     SPC_RETRIES_EXCEEDED,
980     A_KEY_EXCHANGED,
981     SSD_UPDATED,
982     NAM_DOWNLOADED,
983     MDN_DOWNLOADED,
984     IMSI_DOWNLOADED,
985     PRL_DOWNLOADED,
986     COMMITTED,
987     OTAPA_STARTED,
988     OTAPA_STOPPED,
989     OTAPA_ABORTED
990 };
991
992 /* Names of the CDMA info records (C.S0005 section 3.7.5) */
993 enum CdmaInfoRecName : int32_t {
994     DISPLAY,
995     CALLED_PARTY_NUMBER,
996     CALLING_PARTY_NUMBER,
997     CONNECTED_NUMBER,
998     SIGNAL,
999     REDIRECTING_NUMBER,
1000     LINE_CONTROL,
1001     EXTENDED_DISPLAY,
1002     T53_CLIR,
1003     T53_RELEASE,
1004     T53_AUDIO_CONTROL
1005 };
1006
1007 /* Redirecting Number Information Record as defined in C.S0005 section 3.7.5.11 */
1008 enum CdmaRedirectingReason : int32_t {
1009     UNKNOWN = 0,
1010     CALL_FORWARDING_BUSY = 1,
1011     CALL_FORWARDING_NO_REPLY = 2,
1012     CALLED_DTE_OUT_OF_ORDER = 9,
1013     CALL_FORWARDING_BY_THE_CALLED_DTE = 10,
1014     CALL_FORWARDING_UNCONDITIONAL = 15,
1015     RESERVED
1016 };
1017
1018 enum SsServiceType : int32_t {
1019     CFU,
1020     CF_BUSY,
1021     CF_NO_REPLY,
1022     CF_NOT_REACHABLE,
1023     CF_ALL,
1024     CF_ALL_CONDITIONAL,
1025     CLIP,
1026     CLIR,
1027     COLP,
1028     COLR,
1029     WAIT,
1030     BAOC,
1031     BAOIC,
1032     BAOIC_EXC_HOME,
1033     BAIC,
1034     BAIC_ROAMING,
1035     ALL_BARRING,
1036     OUTGOING_BARRING,
1037     INCOMING_BARRING
1038 };
1039
1040 enum SsRequestType : int32_t {
1041     ACTIVATION,
1042     DEACTIVATION,
1043     INTERROGATION,
1044     REGISTRATION,
1045     ERASURE
1046 };
1047
1048 enum SsTeleserviceType : int32_t {
1049     ALL_TELE_AND_BEARER_SERVICES,
1050     ALL_TELESEVICES,
1051     TELEPHONY,
1052     ALL_DATA_TELESERVICES,
1053     SMS_SERVICES,
1054     ALL_TELESERVICES_EXCEPT_SMS
1055 };
1056
1057 enum SuppServiceClass : int32_t {
1058     NONE = 0,
1059     VOICE = 1 << 0,
1060     DATA = 1 << 1,
1061     FAX = 1 << 2,
1062     SMS = 1 << 3,
1063     DATA_SYNC = 1 << 4,
1064     DATA_ASYNC = 1 << 5,
1065     PACKET = 1 << 6,
1066     PAD = 1 << 7,
1067     MAX = 1 << 7
1068 };
1069
1070 struct RadioResponseInfo {
1071     RadioResponseType type;               // Response type
1072     int32_t serial;                       // Serial number of the request
1073     RadioError error;                     // Response error
1074 };
1075
1076 struct AppStatus {
1077     AppType appType;
1078     AppState appState;
1079     PersoSubstate persoSubstate;          // applicable only if app_state == SUBSCRIPTION_PERSO
1080     string aidPtr;                        // e.g., from 0xA0, 0x00 -> 0x41,
1081                                           // 0x30, 0x30, 0x30
1082     string appLabelPtr;
1083     int32_t pin1Replaced;                 // applicable to USIM, CSIM & ISIM
1084     PinState pin1;
1085     PinState pin2;
1086 };
1087
1088 struct CardStatus {
1089     CardState cardState;
1090     PinState universalPinState;           // applicable to USIM and CSIM
1091     int32_t gsmUmtsSubscriptionAppIndex;  // value < RadioConst:CARD_MAX_APPS, -1 if none
1092     int32_t cdmaSubscriptionAppIndex;     // value < RadioConst:CARD_MAX_APPS, -1 if none
1093     int32_t imsSubscriptionAppIndex;      // value < RadioConst:CARD_MAX_APPS, -1 if none
1094     int32_t numApplications;              // value <= RadioConst:CARD_MAX_APPS
1095     AppStatus[RadioConst:CARD_MAX_APPS] applications;
1096 };
1097
1098 /*
1099  * User-to-User Signaling Information defined in 3GPP 23.087 v8.0
1100  */
1101 struct UusInfo {
1102     UusType uusType;                      // UUS Type
1103     UusDcs uusDcs;                        // UUS Data Coding Scheme
1104     string uusData;                       // UUS data
1105 };
1106
1107 struct Call {
1108     CallState state;
1109     int32_t index;                        // Connection Index for use with, eg, AT+CHLD
1110     int32_t toa;                          // type of address, eg 145 = intl
1111     bool isMpty;                          // true if is mpty call
1112     bool isMT;                            // true if call is mobile terminated
1113     uint8_t als;                          // ALS line indicator if available (0 = line 1)
1114     bool isVoice;                         // true if this is is a voice call
1115     bool isVoicePrivacy;                  // true if CDMA voice privacy mode is active
1116     string number;                        // Remote party number
1117     CallPresentation numberPresentation;
1118     string name;                          // Remote party name
1119     CallPresentation namePresentation;
1120     vec<UusInfo> uusInfo;                 // Vector of User-User Signaling Information
1121 };
1122
1123 struct Dial {
1124     string address;
1125     Clir clir;
1126     vec<UusInfo> uusInfo;                 // Vector of User-User Signaling Information
1127 };
1128
1129 struct GsmSignalStrength {
1130     uint32_t signalStrength;              // Valid values are (0-61, 99) as defined in
1131                                           // TS 27.007 8.69
1132     uint32_t bitErrorRate;                // bit error rate (0-7, 99) as defined in TS 27.007 8.5
1133     int32_t timingAdvance;                // Timing Advance in bit periods. 1 bit period = 48/13 us.
1134                                           // INT_MAX denotes invalid value
1135 };
1136
1137 struct WcdmaSignalStrength{
1138     int32_t signalStrength;               // Valid values are (0-96, 99) as defined in
1139                                           // TS 27.007 8.69
1140     int32_t bitErrorRate;                 // bit error rate (0-49, 99) as defined in TS 27.007 8.69
1141 };
1142
1143 struct CdmaSignalStrength {
1144     uint32_t dbm;                         // This value is the actual RSSI
1145                                           // value multiplied by -1. Example: If the
1146                                           // actual RSSI is -75, then this response value will
1147                                           // be 75.
1148     uint32_t ecio;                        // This value is the actual
1149                                           // Ec/Io multiplied by -10. Example: If the
1150                                           // actual Ec/Io is -12.5 dB, then this response value
1151                                           // will be 125.
1152 };
1153
1154 struct EvdoSignalStrength {
1155     uint32_t dbm;                         // This value is the actual
1156                                           // RSSI value multiplied by -1.
1157                                           // Example: If the actual RSSI is -75,
1158                                           // then this response value will be 75.
1159     uint32_t ecio;                        // This value is the actual
1160                                           // Ec/Io multiplied by -10. Example: If the
1161                                           // actual Ec/Io is -12.5 dB, then this response value
1162                                           // will be 125.
1163     uint32_t signalNoiseRatio;            // Valid values are 0-8. 8 is the highest signal to
1164                                           // noise ratio.
1165 };
1166
1167 struct LteSignalStrength {
1168     uint32_t signalStrength;              // Valid values are (0-31, 99) as defined in
1169                                           // TS 27.007 8.5
1170     uint32_t rsrp;                        // The current Reference Signal Receive Power in dBm
1171                                           // multipled by -1.
1172                                           // Range: 44 to 140 dBm
1173                                           // INT_MAX: 0x7FFFFFFF denotes invalid value.
1174                                           // Reference: 3GPP TS 36.133 9.1.4
1175     uint32_t rsrq;                        // The current Reference Signal Receive Quality in dB
1176                                           // multiplied by -1.
1177                                           // Range: 20 to 3 dB.
1178                                           // INT_MAX: 0x7FFFFFFF denotes invalid value.
1179                                           // Reference: 3GPP TS 36.133 9.1.7
1180     int32_t rssnr;                        // The current reference signal signal-to-noise ratio in
1181                                           // 0.1 dB units.
1182                                           // Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB).
1183                                           // INT_MAX : 0x7FFFFFFF denotes invalid value.
1184                                           // Reference: 3GPP TS 36.101 8.1.1
1185     uint32_t cqi;                         // The current Channel Quality Indicator.
1186                                           // Range: 0 to 15.
1187                                           // INT_MAX : 0x7FFFFFFF denotes invalid value.
1188                                           // Reference: 3GPP TS 36.101 9.2, 9.3, A.4
1189     uint32_t timingAdvance;               // timing advance in micro seconds for a one way trip
1190                                           // from cell to device.
1191                                           // Approximate distance is calculated using
1192                                           // 300m/us * timingAdvance.
1193                                           // Range: 0 to 0x7FFFFFFE
1194                                           // INT_MAX : 0x7FFFFFFF denotes invalid value.
1195                                           // Reference: 3GPP 36.321 section 6.1.3.5
1196                                           // also: http://www.cellular-planningoptimization.com/2010/02/timing-advance-with-calculation.html
1197 };
1198
1199 struct TdScdmaSignalStrength {
1200     uint32_t rscp;                        // The Received Signal Code Power in dBm multipled by -1.
1201                                           // Range : 25 to 120
1202                                           // INT_MAX: 0x7FFFFFFF denotes invalid value.
1203                                           // Reference: 3GPP TS 25.123, section 9.1.1.1
1204 };
1205
1206 struct SignalStrength {
1207     GsmSignalStrength gw;
1208     CdmaSignalStrength cdma;
1209     EvdoSignalStrength evdo;
1210     LteSignalStrength lte;
1211     TdScdmaSignalStrength tdScdma;
1212 };
1213
1214 struct SendSmsResult {
1215     int32_t messageRef;                   // TP-Message-Reference for GSM, and BearerData MessageId
1216                                           // for CDMA (See 3GPP2 C.S0015-B, v2.0, table 4.5-1)
1217     string ackPDU;                        // or empty string if n/a
1218     int32_t errorCode;                    // See 3GPP 27.005, 3.2.5 for GSM/UMTS,
1219                                           // 3GPP2 N.S0005 (IS-41C) Table 171 for CDMA,
1220                                           // -1 if unknown or not applicable
1221 };
1222
1223 struct SetupDataCallResult {
1224     int32_t status;                       // A RadioDataCallFailCause, 0 which is
1225                                           // RadioDataCallFailCause:NONE if no error
1226     int32_t suggestedRetryTime;           // If status != 0, this fields indicates the suggested
1227                                           // retry back-off timer value RIL wants to override the
1228                                           // one pre-configured in FW.
1229                                           // The unit is miliseconds.
1230                                           // The value < 0 means no value is suggested.
1231                                           // The value 0 means retry must be done ASAP.
1232                                           // The value of INT_MAX(0x7fffffff) means no retry.
1233     int32_t cid;                          // Context ID, uniquely identifies this call
1234     int32_t active;                       // 0=inactive, 1=active/physical link down,
1235                                           // 2=active/physical link up */
1236     string type;                          // One of the PDP_type values in TS 27.007 section 10.1.1.
1237                                           // For example, "IP", "IPV6", "IPV4V6", or "PPP". If
1238                                           // status is
1239                                           // RadioDataCallFailCause:ONLY_SINGLE_BEARER_ALLOWED this
1240                                           // is the type supported such as "IP" or "IPV6"
1241     string ifname;                        // The network interface name
1242     string addresses;                     // A space-delimited list of addresses with optional "/"
1243                                           // prefix length, e.g., "192.0.1.3" or
1244                                           // "192.0.1.11/16 2001:db8::1/64".
1245                                           // Typically 1 IPv4 or 1 IPv6 or
1246                                           // one of each. If the prefix length is absent the
1247                                           // addresses are assumed to be point to point with IPv4
1248                                           // having a prefix length of 32 and IPv6 128.
1249     string dnses;                         // A space-delimited list of DNS server addresses,
1250                                           // e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
1251                                           // Empty if no dns server addresses returned.
1252     string gateways;                      // A space-delimited list of default gateway addresses,
1253                                           // e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
1254                                           // When empty, the addresses represent
1255                                           // point to point connections.
1256     string pcscf;                         // the Proxy Call State Control Function address
1257                                           // via PCO(Protocol Configuration Option) for IMS client.
1258     int32_t mtu;                          // MTU received from network
1259                                           // Value <= 0 means network has either not sent a
1260                                           // value or sent an invalid value
1261 };
1262
1263 struct IccIo {
1264     int32_t command;                      // one of the commands listed for TS 27.007 +CRSM
1265     int32_t fileid;                       // EF id
1266     string path;                          // "pathid" from TS 27.007 +CRSM command.
1267                                           // Path is in hex asciii format eg "7f205f70"
1268                                           // Path must always be provided.
1269     int32_t p1;                           // Values of p1, p2 & p3 defined as per 3GPP TS 51.011
1270     int32_t p2;
1271     int32_t p3;
1272     string data;                          // information to be written to the SIM
1273     string pin2;
1274     string aidPtr;                        // AID value, See ETSI 102.221 8.1 and 101.220 4, empty
1275                                           // string if no value.
1276 };
1277
1278 struct IccIoResult {
1279     int32_t sw1;
1280     int32_t sw2;
1281     string simResponse;                   // In hex string format ([a-fA-F0-9]*), except for
1282                                           // SIM_AUTHENTICATION response for which it is in
1283                                           // Base64 format, see 3GPP TS 31.102 7.1.2
1284 };
1285
1286 struct VoiceRegStateResult {
1287     RegState regState;
1288     int32_t lac;                          // LAC if registered on a GSM/WCDMA system or
1289                                           // -1 if not.Valid LAC are 0x0000 - 0xffff
1290     int32_t cid;                          // CID. if registered on a * GSM/WCDMA or -1 if not
1291                                           // Valid CID are 0x00000000 - 0xffffffff
1292                                           // In GSM, CID is Cell ID (see TS 27.007) in 16 bits
1293                                           // In UMTS, CID is UMTS Cell Identity (see TS 25.331)
1294                                           // in 28 bits
1295     int32_t rat;                          // indicates the available voice radio technology,
1296                                           // valid values as defined by RIL_RadioTechnology.
1297     int32_t baseStationId;                // Base Station ID. if registered on a CDMA
1298                                           // system or -1 if not. Base Station ID in decimal format
1299     int32_t baseStationLatitude;          // Base Station latitude. if registered on a
1300                                           // CDMA system or -1 if not. Base Station latitude is a
1301                                           // decimal number as specified in 3GPP2 C.S0005-A v6.0.
1302                                           // It is represented in units of 0.25 seconds and ranges
1303                                           // from -1296000 to 1296000, both values inclusive
1304                                           // (corresponding to a range of -90 to +90 degrees).
1305     int32_t baseStationLongitude;         // Base Station longitude. if registered on a
1306                                           // CDMA system or -1 if not. Base Station
1307                                           // longitude is a decimal number as specified in
1308                                           // 3GPP2 C.S0005-A v6.0. It is represented in
1309                                           // units of 0.25 seconds and ranges from -2592000
1310                                           // to 2592000, both values inclusive (corresponding
1311                                           // to a range of -180 to +180 degrees).
1312     bool cssSupported;                    // concurrent services support indicator. if
1313                                           // registered on a CDMA system.
1314                                           // false - Concurrent services not supported,
1315                                           // true - Concurrent services supported
1316     int32_t systemId;                     // System ID. if registered on a CDMA system or
1317                                           // -1 if not. Valid System ID are 0 - 32767
1318     int32_t networkId;                    // Network ID. if registered on a CDMA system or
1319                                           // -1 if not. Valid System ID are 0 - 65535
1320     int32_t roamingIndicator;             // TSB-58 Roaming Indicator if registered
1321                                           // on a CDMA or EVDO system or -1 if not.
1322                                           // Valid values are 0-255.
1323     int32_t systemIsInPrl;                // indicates whether the current system is in the
1324                                           // PRL if registered on a CDMA or EVDO system or -1 if
1325                                           // not. 0=not in the PRL, 1=in the PRL
1326     int32_t defaultRoamingIndicator;      // default Roaming Indicator from the PRL,
1327                                           // if registered on a CDMA or EVDO system or -1 if not.
1328                                           // Valid values are 0-255.
1329     int32_t reasonForDenial;              // reasonForDenial if registration state is 3
1330                                           // (Registration denied) this is an enumerated reason why
1331                                           // registration was denied. See 3GPP TS 24.008,
1332                                           // 10.5.3.6 and Annex G.
1333                                           // 0 - General
1334                                           // 1 - Authentication Failure
1335                                           // 2 - IMSI unknown in HLR
1336                                           // 3 - Illegal MS
1337                                           // 4 - Illegal ME
1338                                           // 5 - PLMN not allowed
1339                                           // 6 - Location area not allowed
1340                                           // 7 - Roaming not allowed
1341                                           // 8 - No Suitable Cells in this Location Area
1342                                           // 9 - Network failure
1343                                           // 10 - Persistent location update reject
1344                                           // 11 - PLMN not allowed
1345                                           // 12 - Location area not allowed
1346                                           // 13 - Roaming not allowed in this Location Area
1347                                           // 15 - No Suitable Cells in this Location Area
1348                                           // 17 - Network Failure
1349                                           // 20 - MAC Failure
1350                                           // 21 - Sync Failure
1351                                           // 22 - Congestion
1352                                           // 23 - GSM Authentication unacceptable
1353                                           // 25 - Not Authorized for this CSG
1354                                           // 32 - Service option not supported
1355                                           // 33 - Requested service option not subscribed
1356                                           // 34 - Service option temporarily out of order
1357                                           // 38 - Call cannot be identified
1358                                           // 48-63 - Retry upon entry into a new cell
1359                                           // 95 - Semantically incorrect message
1360                                           // 96 - Invalid mandatory information
1361                                           // 97 - Message type non-existent or not implemented
1362                                           // 98 - Message type not compatible with protocol state
1363                                           // 99 - Information element non-existent or not implemented
1364                                           // 100 - Conditional IE error
1365                                           // 101 - Message not compatible with protocol state
1366                                           // 111 - Protocol error, unspecified
1367     int32_t psc;                          // Primary Scrambling Code of the current
1368                                           // cell as described in TS 25.331, in hexadecimal
1369                                           // format, or -1 if unknown or not registered
1370                                           // to a UMTS network.
1371 };
1372
1373 struct DataRegStateResult {
1374     RegState regState;                    // Valid reg states are NOT_REG_MT_NOT_SEARCHING_OP,
1375                                           // REG_HOME, NOT_REG_MT_SEARCHING_OP, REG_DENIED,
1376                                           // UNKNOWN, REG_ROAMING defined in RegState
1377     int32_t lac;                          // LAC if registered or -1 if not
1378                                           // valid LAC are 0x0000 - 0xffff
1379     int32_t cid;                          // CID if registered or -1 if not
1380                                           // valid CID are 0x00000000 - 0x0fffffff
1381     int32_t rat;                          // indicates the available data radio technology,
1382                                           // valid values as defined by RIL_RadioTechnology.
1383     int32_t reasonDataDenied;             // if registration state is 3 (Registration
1384                                           // denied) this is an enumerated reason why
1385                                           // registration was denied. See 3GPP TS 24.008,
1386                                           // Annex G.6 "Additonal cause codes for GMM".
1387                                           // 7 == GPRS services not allowed
1388                                           // 8 == GPRS services and non-GPRS services not allowed
1389                                           // 9 == MS identity cannot be derived by the network
1390                                           // 10 == Implicitly detached
1391                                           // 14 == GPRS services not allowed in this PLMN
1392                                           // 16 == MSC temporarily not reachable
1393                                           // 40 == No PDP context activated
1394     int32_t maxDataCalls;                 // The maximum number of simultaneous Data Calls that
1395                                           // must be established using setupDataCall().
1396     // The values below are optional LTE location information in decimal.
1397     // If a value is unknown that value must be -1.
1398     int32_t tac;                          // a 16-bit Tracking Area Code.
1399     int32_t phyCid;                       // a 0-503 Physical Cell Identifier.
1400     int32_t eci;                          // a 28-bit E-UTRAN Cell Identifier.
1401     int32_t csgid;                        // a 27-bit Closed Subscriber Group Identity.
1402     int32_t tadv;                         // a 6-bit timing advance value.
1403 };
1404
1405 // See also com.android.internal.telephony.gsm.CallForwardInfo
1406 struct CallForwardInfo {
1407     CallForwardInfoStatus status;         // For queryCallForwardStatus()
1408                                           // status must be ACTIVE, INACTIVE
1409                                           // For setCallForward():
1410                                           // status must be
1411                                           // DISABLE, ENABLE, INTERROGATE, REGISTRATION, ERASURE
1412     int32_t reason;                       // from TS 27.007 7.11 "reason"
1413     int32_t serviceClass;                 // From 27.007 +CCFC/+CLCK "class"
1414                                           // See table for Android mapping from
1415                                           // MMI service code
1416                                           // 0 means user doesnt input class
1417     int32_t toa;                          // "type" from TS 27.007 7.11
1418     string number;                        // "number" from TS 27.007 7.11.
1419     int32_t timeSeconds;
1420 };
1421
1422 // Response struct used in responseQueryAvailableNetworks
1423 struct OperatorInfo {
1424     string alphaLong;                     // long alpha ONS or EONS
1425     string alphaShort;                    // short alpha ONS or EONS
1426     string operatorNumeric;               // 5 or 6 digit numeric code (MCC + MNC)
1427     OperatorStatus status;
1428 };
1429
1430 struct SmsWriteArgs {
1431     SmsWriteArgsStatus status;            // Status of message. See TS 27.005 3.1
1432     string pdu;                           // PDU of message to write, as an ASCII hex string less
1433                                           // the SMSC address, the TP-layer length is strlen(pdu)/2.
1434     string smsc;                          // SMSC address in GSM BCD format prefixed by a length
1435                                           // byte (as expected by TS 27.005) or NULL for default
1436                                           // SMSC
1437 };
1438
1439 struct CdmaSmsAddress {
1440     CdmaSmsDigitMode digitMode;          // CdmaSmsDigitMode is of two types : 4 bit & 8 bit.
1441                                          // For 4-bit type, only "digits" field defined below in
1442                                          // this struct is used.
1443     CdmaSmsNumberMode numberMode;        // Used only when digitMode is 8-bit
1444     CdmaSmsNumberType numberType;        // Used only when digitMode is 8-bit.
1445                                          // To specify an international address, use the following:
1446                                          // digitMode = CdmaSmsDigitMode:EIGHT_BIT:
1447                                          // numberMode = CdmaSmsNumberMode:NOT_DATA_NETWORK
1448                                          // numberType = CdmaSmsNumberType:INTERNATIONAL_OR_DATA_IP
1449                                          // numberPlan = CdmaSmsNumberPlan:TELEPHONY
1450                                          // numberOfDigits = number of digits
1451                                          // digits = ASCII digits, e.g. '1', '2', '3', '4', and '5'
1452     CdmaSmsNumberPlan numberPlan;        // Used only when digitMode is 8-bit
1453     vec<uint8_t> digits;                 // Each byte in this array represents a 4 bit or 8-bit digit
1454                                          // of address data
1455 };
1456
1457 struct CdmaSmsSubaddress {
1458     CdmaSmsSubaddressType subaddressType;
1459     bool odd;                            // true means the last byte's lower 4 bits must be ignored
1460     vec<uint8_t> digits;                 // Each byte respresents an 8-bit digit of subaddress data
1461 };
1462
1463 struct CdmaSmsMessage {
1464     int32_t teleserviceId;
1465     bool isServicePresent;
1466     int32_t serviceCategory;
1467     CdmaSmsAddress address;
1468     CdmaSmsSubaddress subAddress;
1469     vec<uint8_t> bearerData;             // 3GPP2 C.S0015-B, v2.0,
1470 };
1471
1472 struct CdmaSmsAck {
1473     CdmaSmsErrorClass errorClass;
1474     int32_t smsCauseCode;                // As defined in N.S00005, 6.5.2.125.
1475                                          // Currently, only 35 (resource shortage) and
1476                                          // 39 (other terminal problem) are reported.
1477 };
1478
1479 struct CdmaBroadcastSmsConfigInfo {
1480     int32_t serviceCategory;             // serviceCategory defines a Broadcast message identifier
1481                                          // whose value is 0x0000 - 0xFFFF as defined in
1482                                          // C.R1001G 9.3.1 and 9.3.2.
1483     int32_t language;                    // language code of Broadcast Message
1484                                          // whose value is 0x00 - 0x07 as defined in C.R1001G 9.2.
1485     bool selected;                       // selected false means message types specified in
1486                                          // serviceCategory are not accepted, while true means
1487                                          // accepted.
1488 };
1489
1490 struct CdmaSmsWriteArgs {
1491     CdmaSmsWriteArgsStatus status;       // Status of message. See TS 27.005 3.1
1492     CdmaSmsMessage message;
1493 };
1494
1495
1496 /**
1497  * Which types of Cell Broadcast Message (CBM) are to be received by the ME
1498  *
1499  * fromServiceID - uToServiceID defines a range of CBM message identifiers
1500  * whose value is 0x0000 - 0xFFFF as defined in TS 23.041 9.4.1.2.2 for GMS
1501  * and 9.4.4.2.2 for UMTS. All other values must be treated as empty
1502  * CBM message ID.
1503  *
1504  * fromCodeScheme - uToCodeScheme defines a range of CBM data coding schemes
1505  * whose value is 0x00 - 0xFF as defined in TS 23.041 9.4.1.2.3 for GMS
1506  * and 9.4.4.2.3 for UMTS.
1507  * All other values must be treated as empty CBM data coding scheme.
1508  *
1509  * selected false means message types specified in <fromServiceId, toServiceId>
1510  * and <fromCodeScheme, toCodeScheme>are not accepted, while true means accepted.
1511  */
1512 struct GsmBroadcastSmsConfigInfo {
1513     int32_t fromServiceId;
1514     int32_t toServiceId;
1515     int32_t fromCodeScheme;
1516     int32_t toCodeScheme;
1517     bool selected;
1518 };
1519
1520 struct CellIdentityGsm {
1521     string mcc;                          // 3-digit Mobile Country Code, 0..999, INT_MAX if unknown
1522     string mnc;                          // 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if
1523                                          // unknown
1524     int32_t lac;                         // 16-bit Location Area Code, 0..65535, INT_MAX if unknown
1525     int32_t cid;                         // 16-bit GSM Cell Identity described in
1526                                          // TS 27.007, 0..65535, INT_MAX if unknown
1527     int32_t arfcn;                       // 16-bit GSM Absolute RF channel number, INT_MAX if
1528                                          // unknown
1529     uint8_t bsic;                        // 6-bit Base Station Identity Code, 0xFF if unknown
1530 };
1531
1532 struct CellIdentityWcdma {
1533     string mcc;                          // 3-digit Mobile Country Code, 0..999, INT_MAX if unknown
1534     string mnc;                          // 2 or 3-digit Mobile Network Code, 0..999, INT_MAX
1535                                          // if unknown
1536     int32_t lac;                         // 16-bit Location Area Code, 0..65535, INT_MAX if unknown
1537     int32_t cid;                         // 28-bit UMTS Cell Identity described in
1538                                          // TS 25.331, 0..268435455, INT_MAX if unknown
1539     int32_t psc;                         // 9-bit UMTS Primary Scrambling Code described in
1540                                          // TS 25.331, 0..511, INT_MAX if unknown
1541     int32_t uarfcn;                      // 16-bit UMTS Absolute RF Channel Number, INT_MAX if
1542                                          // unknown
1543 };
1544
1545 struct CellIdentityCdma {
1546     int32_t networkId;                   // Network Id 0..65535, INT_MAX if unknown
1547     int32_t systemId;                    // CDMA System Id 0..32767, INT_MAX if unknown
1548     int32_t basestationId;               // Base Station Id 0..65535, INT_MAX if unknown
1549     int32_t longitude;                   // Longitude is a decimal number as specified in
1550                                          // 3GPP2 C.S0005-A v6.0. It is represented in units of
1551                                          // 0.25 seconds and ranges from -2592000 to 2592000,
1552                                          // both values inclusive (corresponding to a range of -180
1553                                          // to +180 degrees). INT_MAX if unknown
1554     int32_t latitude;                    // Latitude is a decimal number as specified in
1555                                          // 3GPP2 C.S0005-A v6.0. It is represented in units of
1556                                          // 0.25 seconds and ranges from -1296000 to 1296000,
1557                                          // both values inclusive (corresponding to a range of -90
1558                                          // to +90 degrees). INT_MAX if unknown
1559 };
1560
1561 struct CellIdentityLte {
1562     string mcc;                          // 3-digit Mobile Country Code, 0..999, INT_MAX if unknown
1563     string mnc;                          // 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if
1564                                          // unknown
1565     int32_t ci;                          // 28-bit Cell Identity described in TS TS 27.007, INT_MAX
1566                                          // if unknown
1567     int32_t pci;                         // physical cell id 0..503, INT_MAX if unknown
1568     int32_t tac;                         // 16-bit tracking area code, INT_MAX if unknown
1569     int32_t earfcn;                      // 18-bit LTE Absolute RC Channel Number, INT_MAX if
1570                                          // unknown
1571 };
1572
1573 struct CellIdentityTdscdma {
1574     string mcc;                          // 3-digit Mobile Country Code, 0..999, INT_MAX if unknown
1575     string mnc;                          // 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if
1576                                          // unknown
1577     int32_t lac;                         // 16-bit Location Area Code, 0..65535, INT_MAX if
1578                                          // unknown
1579     int32_t cid;                         // 28-bit UMTS Cell Identity described in
1580                                          // TS 25.331, 0..268435455, INT_MAX if unknown
1581     int32_t cpid;                        // 8-bit Cell Parameters ID described in
1582                                          // TS 25.331, 0..127, INT_MAX if unknown
1583 };
1584
1585 struct CellInfoGsm {
1586     CellIdentityGsm cellIdentityGsm;
1587     GsmSignalStrength signalStrengthGsm;
1588 };
1589
1590 struct CellInfoWcdma {
1591     CellIdentityWcdma cellIdentityWcdma;
1592     WcdmaSignalStrength signalStrengthWcdma;
1593 };
1594
1595 struct CellInfoCdma {
1596     CellIdentityCdma cellIdentityCdma;
1597     CdmaSignalStrength signalStrengthCdma;
1598     EvdoSignalStrength signalStrengthEvdo;
1599 };
1600
1601 struct CellInfoLte {
1602     CellIdentityLte cellIdentityLte;
1603     LteSignalStrength signalStrengthLte;
1604 };
1605
1606 struct CellInfoTdscdma {
1607     CellIdentityTdscdma cellIdentityTdscdma;
1608     TdScdmaSignalStrength signalStrengthTdscdma;
1609 };
1610
1611 struct CellInfo {
1612     CellInfoType cellInfoType;           // cell type for selecting from union CellInfo
1613     bool registered;                     // true if this cell is registered false if not registered
1614     TimeStampType timeStampType;         // type of time stamp represented by timeStamp
1615     uint64_t timeStamp;                  // Time in nanos as returned by ril_nano_time
1616     // Only one of the below vectors must be of size 1 based on the CellInfoType & others must be
1617     // of size 0
1618     vec<CellInfoGsm> gsm;                // Valid only if type = gsm and size = 1 else must be empty
1619     vec<CellInfoCdma> cdma;              // Valid only if type = cdma and size = 1 else must be
1620                                          // empty
1621     vec<CellInfoLte> lte;                // Valid only if type = lte and size = 1 else must be
1622                                          // empty
1623     vec<CellInfoWcdma> wcdma;            // Valid only if type = wcdma and size = 1 else must be
1624                                          // empty
1625     vec<CellInfoTdscdma> tdscdma;        // Valid only if type = tdscdma and size = 1 else must be
1626                                          // empty
1627 };
1628
1629 struct GsmSmsMessage {
1630     string smscPdu;                      // SMSC address in GSM BCD format prefixed by a length
1631                                          // byte (as expected by TS 27.005) or empty string for
1632                                          // default SMSC
1633     string pdu;                          // SMS in PDU format as an ASCII hex string less the
1634                                          // SMSC address. TP-Layer-Length is be "strlen(pdu)/2
1635 };
1636
1637 struct ImsSmsMessage {
1638     RadioTechnologyFamily tech;
1639     bool retry;                          // false == not retry, true == retry */
1640     int32_t messageRef;                  // Valid field if retry is set to true.
1641                                          // Contains messageRef from SendSmsResult stuct
1642                                          // corresponding to failed MO SMS.
1643     // Only one of the below vectors must be of size 1 based on the RadioTechnologyFamily & others
1644     // must be of size 0
1645     vec<CdmaSmsMessage> cdmaMessage;     // Valid field if tech is 3GPP2 and size = 1 else must be
1646                                          // empty
1647     vec<GsmSmsMessage> gsmMessage;       // Valid field if tech is 3GPP and size = 1 else must be
1648                                          // empty
1649 };
1650
1651 struct SimApdu {
1652     int32_t sessionid;                   // "sessionid" from TS 27.007 +CGLA command. Must be
1653                                          // ignored for +CSIM command.
1654     // Following fields are used to derive the APDU ("command" and "length"
1655     // values in TS 27.007 +CSIM and +CGLA commands).
1656     int32_t cla;
1657     int32_t instruction;
1658     int32_t p1;
1659     int32_t p2;
1660     int32_t p3;                          // A negative P3 implies a 4 byte APDU.
1661     string data;                         // In hex string format ([a-fA-F0-9]*).
1662 };
1663
1664 struct NvWriteItem {
1665     NvItem itemID;
1666     string value;
1667 };
1668
1669 struct SelectUiccSub {
1670     int32_t slot;
1671     int32_t appIndex;                   // array subscriptor from
1672                                         // applications[RadioConst:CARD_MAX_APPS] in
1673                                         // getIccCardStatus()
1674     SubscriptionType subType;
1675     UiccSubActStatus actStatus;
1676 };
1677
1678 struct HardwareConfigModem {
1679     int32_t rilModel;
1680     uint32_t rat;                       // bitset - ref. RadioTechnology.
1681     int32_t maxVoice;
1682     int32_t maxData;
1683     int32_t maxStandby;
1684 };
1685
1686 struct HardwareConfigSim {
1687     string modemUuid;                   // RadioConst:MAX_UUID_LENGTH is max length of the
1688                                         // string
1689 };
1690
1691 struct HardwareConfig {
1692     HardwareConfigType type;
1693     string uuid;                         // RadioConst:MAX_UUID_LENGTH is max length of the
1694                                          // string
1695     HardwareConfigState state;
1696     // Only one of the below vectors must have size = 1 based on the HardwareConfigType and other
1697     // must have size = 0.
1698     vec<HardwareConfigModem> modem;      // Valid only if type is Modem and size = 1 else must be
1699                                          // empty
1700     vec<HardwareConfigSim> sim;          // Valid only if type is SIM or else emptyand size = 1
1701                                          // else must be empty
1702 };
1703
1704 struct DataProfileInfo {
1705     int32_t profileId;                   // id of the data profile
1706     string apn;                          // The APN to connect to
1707     string protocol;                     // One of the PDP_type values in TS 27.007 section 10.1.1.
1708                                          // For example, "IP", "IPV6", "IPV4V6", or "PPP".
1709     ApnAuthType authType;
1710     string user;                         // The username for APN, or empty string
1711     string password;                     // The password for APN, or empty string
1712     DataProfileInfoType type;
1713     int32_t maxConnsTime;                // The period in seconds to limit the maximum connections
1714     int32_t maxConns;                    // The maximum connections during maxConnsTime
1715     int32_t waitTime;                    // The required wait time in seconds after a successful UE
1716                                          // initiated disconnect of a given PDN connection before
1717                                          // the device can send a new PDN connection request for
1718                                          // that given PDN
1719     bool enabled;                        // True to enable the profile, false to disable
1720 };
1721
1722 struct RadioCapability {
1723     int32_t session;                     // Unique session value defined by framework returned in
1724                                          // all "responses/unsol"
1725     RadioCapabilityPhase phase;
1726     RadioAccessFamily raf;
1727     string logicalModemUuid;             // A UUID typically "com.xxxx.lmX where X is the logical
1728                                          // modem. RadioConst:MAX_UUID_LENGTH is the max
1729                                          // length
1730     RadioCapabilityStatus status;
1731 };
1732
1733 struct LceStatusInfo {
1734     LceStatus lceStatus;
1735     uint8_t actualIntervalMs;            // actual LCE reporting interval,
1736                                          // meaningful only if LceStatus = ACTIVE.
1737 };
1738
1739 struct LceDataInfo {
1740     uint32_t lastHopCapacityKbps;          // last-hop cellular capacity: kilobits/second.
1741     uint8_t confidenceLevel;               // capacity estimate confidence: 0-100
1742     bool lceSuspended;                     // LCE report going to be suspended? (e.g., radio
1743                                            // moves to inactive state or network type change)
1744                                            // true = suspended;
1745                                            // false = not suspended.
1746 };
1747
1748 struct ActivityStatsInfo {
1749     uint32_t sleepModeTimeMs;              // total time (in ms) when modem is in a low power or
1750                                            // sleep state
1751     uint32_t idleModeTimeMs;               // total time (in ms) when modem is awake but neither
1752                                            // the transmitter nor receiver are active/awake
1753     uint32_t[RadioConst:NUM_TX_POWER_LEVELS] txmModetimeMs;
1754                                            // Each index represent total time (in ms) during which
1755                                            // the transmitter is active/awake for a particular
1756                                            // power range as shown below.
1757                                            // index 0 = tx_power < 0dBm
1758                                            // index 1 = 0dBm < tx_power < 5dBm
1759                                            // index 2 = 5dBm < tx_power < 15dBm
1760                                            // index 3 = 15dBm < tx_power < 20dBm
1761                                            // index 4 = tx_power > 20dBm
1762     uint32_t rxModeTimeMs;                 // total time (in ms) for which receiver is
1763                                            // active/awake and the transmitter is inactive
1764 };
1765
1766 struct Carrier {
1767     string mcc;
1768     string mnc;
1769     CarrierMatchType matchType;            // Specify match type for the carrier.
1770                                            // If it’s ALL, matchData is empty string;
1771                                            // otherwise, matchData is the value for the match type.
1772     string matchData;
1773 };
1774
1775 struct CarrierRestrictions {
1776     vec<Carrier> allowedCarriers;          // whitelist for allowed carriers
1777     vec<Carrier> excludedCarriers;         // blacklist for explicitly excluded carriers
1778                                            // which match allowed_carriers. Eg. allowedCarriers
1779                                            // match mcc/mnc, excludedCarriers has same mcc/mnc and
1780                                            // gid1 is ABCD. It means except the carrier whose gid1
1781                                            // is ABCD, all carriers with the same mcc/mnc are
1782                                            // allowed.
1783 };
1784
1785 struct SuppSvcNotification {
1786     bool isMT;                             // notification type
1787                                            // false = MO intermediate result code
1788                                            // true = MT unsolicited result code
1789     bool isCode1;                          // See 27.007 7.17
1790                                            // true = "code1" for MO
1791                                            // false = "code2" for MT
1792     int32_t index;                         // CUG index. See 27.007 7.17.
1793     int32_t type;                          // "type" from 27.007 7.17 (MT only).
1794     string number;                         // "number" from 27.007 7.17
1795                                            // (MT only, may be empty string).
1796 };
1797
1798 struct SimRefreshResult {
1799     SimRefreshType type;
1800     int32_t efId;                          // is the EFID of the updated file if the result is
1801                                            // SIM_FILE_UPDATE or 0 for any other result.
1802     string aid;                            // is AID(application ID) of the card application
1803                                            // See ETSI 102.221 8.1 and 101.220 4
1804                                            // For SIM_FILE_UPDATE result it must be set to AID of
1805                                            // application in which updated EF resides or it must be
1806                                            // empty string if EF is outside of an application.
1807                                            // For SIM_INIT result this field is set to AID of
1808                                            // application that caused REFRESH
1809                                            // For SIM_RESET result it is empty string.
1810 };
1811
1812 /* CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */
1813 struct CdmaSignalInfoRecord {
1814     bool isPresent;                        // true if signal information record is present
1815     int8_t signalType;                     // as defined 3.7.5.5-1
1816     int8_t alertPitch;                     // as defined 3.7.5.5-2
1817     int8_t signal;                         // as defined 3.7.5.5-3, 3.7.5.5-4 or 3.7.5.5-5
1818 };
1819
1820 struct CdmaCallWaiting {
1821     string number;                         // Remote party number
1822     CdmaCallWaitingNumberPresentation numberPresentation;
1823     string name;                           // Remote party name
1824     CdmaSignalInfoRecord signalInfoRecord;
1825     // Number type/Number plan required to support International Call Waiting
1826     CdmaCallWaitingNumberType numbertype;
1827     CdmaCallWaitingNumberPlan numberPlan;
1828 };
1829
1830 /*
1831  * Display Info Rec as defined in C.S0005 section 3.7.5.1
1832  * Extended Display Info Rec as defined in C.S0005 section 3.7.5.16
1833  * Note: the Extended Display info rec contains multiple records of the
1834  * form: display_tag, display_len, and display_len occurrences of the
1835  * char field if the display_tag is not 10000000 or 10000001.
1836  * To save space, the records are stored consecutively in a byte buffer.
1837  * The display_tag, display_len and chari fields are all 1 byte.
1838  */
1839 struct CdmaDisplayInfoRecord {
1840     string alphaBuf;                       // Max length = RadioConst:CDMA_ALPHA_INFO_BUFFER_LENGTH
1841 };
1842
1843 /*
1844  * Called Party Number Info Rec as defined in C.S0005 section 3.7.5.2
1845  * Calling Party Number Info Rec as defined in C.S0005 section 3.7.5.3
1846  * Connected Number Info Rec as defined in C.S0005 section 3.7.5.4
1847  */
1848 struct CdmaNumberInfoRecord {
1849     string number;                         // Max length = RADIP_CDMA_NUMBER_INFO_BUFFER_LENGTH
1850     uint8_t numberType;
1851     uint8_t numberPlan;
1852     uint8_t pi;
1853     uint8_t si;
1854 };
1855
1856 struct  CdmaRedirectingNumberInfoRecord{
1857     CdmaNumberInfoRecord redirectingNumber;
1858     CdmaRedirectingReason redirectingReason; // redirectingReason is set to UNKNOWN if not included
1859 };
1860
1861 /* Line Control Information Record as defined in C.S0005 section 3.7.5.15 */
1862 struct CdmaLineControlInfoRecord {
1863     uint8_t lineCtrlPolarityIncluded;
1864     uint8_t lineCtrlToggle;
1865     uint8_t lineCtrlReverse;
1866     uint8_t lineCtrlPowerDenial;
1867 };
1868
1869 /* T53 CLIR Information Record */
1870 struct CdmaT53ClirInfoRecord {
1871     uint8_t cause;
1872 };
1873
1874 /* T53 Audio Control Information Record */
1875 struct CdmaT53AudioControlInfoRecord {
1876     uint8_t upLink;
1877     uint8_t downLink;
1878 };
1879
1880 struct CdmaInformationRecord {
1881     CdmaInfoRecName name;
1882     // Only one of the below vectors must have size = 1 based on the
1883     // CdmaInfoRecName. All other vectors must have size 0.
1884     vec<CdmaDisplayInfoRecord> display;  // Display and Extended Display Info Rec
1885     vec<CdmaNumberInfoRecord> number;    // Called Party Number, Calling Party Number, Connected
1886                                          // number Info Rec
1887     vec<CdmaSignalInfoRecord> signal;    // Signal Info Rec
1888     vec<CdmaRedirectingNumberInfoRecord> redir; // Redirecting Number Info Rec
1889     vec<CdmaLineControlInfoRecord> lineCtrl;    // Line Control Info Rec
1890     vec<CdmaT53ClirInfoRecord> clir;     // T53 CLIR Info Rec
1891     vec<CdmaT53AudioControlInfoRecord> audioCtrl; // T53 Audio Control Info Rec
1892 };
1893
1894 struct CdmaInformationRecords {
1895     vec<CdmaInformationRecord> infoRec;  // Max length = RadioConst:CDMA_MAX_NUMBER_OF_INFO_RECS
1896 };
1897
1898 struct CfData {
1899     vec<CallForwardInfo> cfInfo;         // This is the response data
1900                                          // for SS request to query call
1901                                          // forward status. see getCallForwardStatus()
1902                                          // Max size = RadioConst:NUM_SERVICE_CLASSES
1903 };
1904
1905 struct SsInfoData {
1906     vec<int32_t> ssInfo;                 // This is the response data for all of the SS GET/SET
1907                                          // Radio requests. E.g. IRadio.getClir() returns
1908                                          // two ints, so first two values of ssInfo[] will be
1909                                          // used for response if serviceType is SS_CLIR and
1910                                          // requestType is SS_INTERROGATION
1911                                          // Max size = RadioConst:SS_INFO_MAX
1912 };
1913
1914 struct StkCcUnsolSsResult {
1915     SsServiceType serviceType;
1916     SsRequestType requestType;
1917     SsTeleserviceType teleserviceType;
1918     SuppServiceClass serviceClass;
1919     RadioError result;
1920     // Only one of the below vectors may contain values and other must be empty
1921     vec<SsInfoData> ssInfo;              // Valid only for all SsserviceType except
1922                                          // SsServiceType:CF_* else empty.
1923     vec<CfData> cfData;                  // Valid for SsServiceType:CF_* else empty
1924 };
1925
1926 struct PcoDataInfo {
1927     int32_t cid;                         // Context ID, uniquely identifies this call
1928     string bearerProto;                  // One of the PDP_type values in TS 27.007 section 10.1.1.
1929                                          // For example, "IP", "IPV6", "IPV4V6"
1930     int32_t pcoId;                       // The protocol ID for this box. Note that only IDs from
1931                                          // FF00H - FFFFH are accepted. If more than one is
1932                                          // included from the network, multiple calls must be made
1933                                          // to send all of them.
1934     vec<uint8_t> contents;               // Carrier-defined content. It is binary, opaque and
1935                                          // loosely defined in LTE Layer 3 spec 24.008
1936 };