OSDN Git Service

Merge "Initial definition of data types and enumerations for OBD2-compatible diagnost...
[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     NONE = 0,                             // Success
55     RADIO_NOT_AVAILABLE = 1,              // If radio did not start or is resetting
56     GENERIC_FAILURE = 2,
57     PASSWORD_INCORRECT = 3,               // for PIN/PIN2 methods only
58     SIM_PIN2 = 4,                         // Operation requires SIM PIN2 to be entered
59     SIM_PUK2 = 5,                         // Operation requires SIM PIN2 to be entered
60     REQUEST_NOT_SUPPORTED = 6,
61     CANCELLED = 7,
62     OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, // data ops are not allowed during voice
63                                           // call on a Class C GPRS device
64     OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9,  // data ops are not allowed before device
65                                           // registers in network
66     SMS_SEND_FAIL_RETRY = 10,             // fail to send sms and need retry
67     SIM_ABSENT = 11,                      // fail to set the location where CDMA subscription
68                                           // shall be retrieved because of SIM or RUIM
69                                           // card absent
70     SUBSCRIPTION_NOT_AVAILABLE = 12,      // fail to find CDMA subscription from specified
71                                           // location
72     MODE_NOT_SUPPORTED = 13,              // HW does not support preferred network type
73     FDN_CHECK_FAILURE = 14,               // command failed because recipient is not on FDN list
74     ILLEGAL_SIM_OR_ME = 15,               // network selection failed due to illegal SIM or ME
75     MISSING_RESOURCE = 16,                // no logical channel available
76     NO_SUCH_ELEMENT = 17,                 // application not found on SIM
77     DIAL_MODIFIED_TO_USSD = 18,           // DIAL request modified to USSD
78     DIAL_MODIFIED_TO_SS = 19,             // DIAL request modified to SS
79     DIAL_MODIFIED_TO_DIAL = 20,           // DIAL request modified to DIAL with different data
80     USSD_MODIFIED_TO_DIAL = 21,           // USSD request modified to DIAL
81     USSD_MODIFIED_TO_SS = 22,             // USSD request modified to SS
82     USSD_MODIFIED_TO_USSD = 23,           // USSD request modified to different USSD request
83     SS_MODIFIED_TO_DIAL = 24,             // SS request modified to DIAL
84     SS_MODIFIED_TO_USSD = 25,             // SS request modified to USSD
85     SUBSCRIPTION_NOT_SUPPORTED = 26,      // Subscription not supported by RIL
86     SS_MODIFIED_TO_SS = 27,               // SS request modified to different SS request
87     LCE_NOT_SUPPORTED = 36,               // LCE service not supported(36 in RILConstants.java)
88     NO_MEMORY = 37,                       // Not sufficient memory to process the request
89     INTERNAL_ERR = 38,                    // Hit unexpected vendor internal error scenario
90     SYSTEM_ERR = 39,                      // Hit platform or system error
91     MODEM_ERR = 40,                       // Hit unexpected modem error
92     INVALID_STATE = 41,                   // Unexpected request for the current state
93     NO_RESOURCES = 42,                    // Not sufficient resource to process the request
94     SIM_ERR = 43,                         // Received error from SIM card
95     INVALID_ARGUMENTS = 44,               // Received invalid arguments in request
96     INVALID_SIM_STATE = 45,               // Cannot process the request in current SIM state
97     INVALID_MODEM_STATE = 46,             // Cannot process the request in current Modem state
98     INVALID_CALL_ID = 47,                 // Received invalid call id in request
99     NO_SMS_TO_ACK = 48,                   // ACK received when there is no SMS to ack
100     NETWORK_ERR = 49,                     // Received error from network
101     REQUEST_RATE_LIMITED = 50,            // Operation denied due to overly-frequent requests
102     SIM_BUSY = 51,                        // SIM is busy
103     SIM_FULL = 52,                        // The target EF is full
104     NETWORK_REJECT = 53,                  // Request is rejected by network
105     OPERATION_NOT_ALLOWED = 54,           // Not allowed the request now
106     EMPTY_RECORD = 55,                    // The request record is empty
107     INVALID_SMS_FORMAT = 56,              // Invalid sms format
108     ENCODING_ERR = 57,                    // Message not encoded properly
109     INVALID_SMSC_ADDRESS = 58,            // SMSC address specified is invalid
110     NO_SUCH_ENTRY = 59,                   // No such entry present to perform the request
111     NETWORK_NOT_READY = 60,               // Network is not ready to perform the request
112     NOT_PROVISIONED = 61,                 // Device doesnot have this value provisioned
113     NO_SUBSCRIPTION = 62,                 // Device doesnot have subscription
114     NO_NETWORK_FOUND = 63,                // Network cannot be found
115     DEVICE_IN_USE = 64,                   // Operation cannot be performed because the device
116                                           // is currently in use
117     ABORTED = 65,                         // Operation aborted
118     INVALID_RESPONSE = 66,                // Response from vendor had invalid data
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     DISABLE,
566     ENABLE,
567     INTERROGATE,
568     REGISTRATION,
569     ERASURE,
570 };
571
572 enum ClipStatus : int32_t {
573     CLIP_PROVISIONED,                     // CLIP provisioned
574     CLIP_UNPROVISIONED,                   // CLIP not provisioned
575     UNKOWN,                               // unknown, e.g. no network etc
576 };
577
578 enum SmsWriteArgsStatus : int32_t {
579     REC_UNREAD,
580     REC_READ,
581     STO_UNSENT,
582     STO_SENT,
583 };
584
585 enum RadioBandMode : int32_t  {
586     BAND_MODE_UNSPECIFIED,                // "unspecified" (selected by baseband automatically)
587     BAND_MODE_EURO,                       // "EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000)
588     BAND_MODE_USA,                        // "US band"
589                                           // (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900)
590     BAND_MODE_JPN,                        // "JPN band" (WCDMA-800 / WCDMA-IMT-2000)
591     BAND_MODE_AUS,                        // "AUS band"
592                                           // (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000)
593     BAND_MODE_AUS_2,                      // "AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850)
594     BAND_MODE_CELL_800,                   // "Cellular" (800-MHz Band)
595     BAND_MODE_PCS,                        // "PCS" (1900-MHz Band)
596     BAND_MODE_JTACS,                      // "Band Class 3" (JTACS Band)
597     BAND_MODE_KOREA_PCS,                  // "Band Class 4" (Korean PCS Band)
598     BAND_MODE_5_450M,                     // "Band Class 5" (450-MHz Band)
599     BAND_MODE_IMT2000,                    // "Band Class 6" (2-GMHz IMT2000 Band)
600     BAND_MODE_7_700M_2,                   // "Band Class 7" (Upper 700-MHz Band)
601     BAND_MODE_8_1800M,                    // "Band Class 8" (1800-MHz Band)
602     BAND_MODE_9_900M,                     // "Band Class 9" (900-MHz Band)
603     BAND_MODE_10_800M_2,                  // "Band Class 10" (Secondary 800-MHz Band)
604     BAND_MODE_EURO_PAMR_400M,             // "Band Class 11" (400-MHz European PAMR Band)
605     BAND_MODE_AWS,                        // "Band Class 15" (AWS Band)
606     BAND_MODE_USA_2500M,                  // "Band Class 16" (US 2.5-GHz Band)
607 };
608
609 enum OperatorStatus : int32_t {
610     UNKNOWN,
611     AVAILABLE,
612     CURRENT,
613     FORBIDDEN,
614 };
615
616 enum PreferredNetworkType : int32_t {
617     GSM_WCDMA,                            // GSM/WCDMA (WCDMA preferred)
618     GSM_ONLY,                             // GSM only
619     WCDMA,                                // WCDMA
620     GSM_WCDMA_AUTO,                       // GSM/WCDMA (auto mode, according to PRL)
621     CDMA_EVDO_AUTO,                       // CDMA and EvDo (auto mode, according to PRL)
622     CDMA_ONLY,                            // CDMA only
623     EVDO_ONLY,                            // EvDo only
624     GSM_WCDMA_CDMA_EVDO_AUTO,             // GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL)
625     LTE_CDMA_EVDO,                        // LTE, CDMA and EvDo
626     LTE_GSM_WCDMA,                        // LTE, GSM/WCDMA
627     LTE_CMDA_EVDO_GSM_WCDMA,              // LTE, CDMA, EvDo, GSM/WCDMA
628     LTE_ONLY,                             // LTE only
629     LTE_WCDMA,                            // LTE/WCDMA
630     TD_SCDMA_ONLY,                        // TD-SCDMA only
631     TD_SCDMA_WCDMA,                       // TD-SCDMA and WCDMA
632     TD_SCDMA_LTE,                         // TD-SCDMA and LTE
633     TD_SCDMA_GSM,                         // TD-SCDMA and GSM
634     TD_SCDMA_GSM_LTE,                     // TD-SCDMA,GSM and LTE
635     TD_SCDMA_GSM_WCDMA,                   // TD-SCDMA, GSM/WCDMA
636     TD_SCDMA_WCDMA_LTE,                   // TD-SCDMA, WCDMA and LTE
637     TD_SCDMA_GSM_WCDMA_LTE,               // TD-SCDMA, GSM/WCDMA and LTE
638     TD_SCDMA_GSM_WCDMA_CDMA_EVDO_AUTO,    // TD-SCDMA, GSM/WCDMA, CDMA and EvDo
639     TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA,     // TD-SCDMA, LTE, CDMA, EvDo GSM/WCDMA
640 };
641
642 enum CdmaSubscriptionSource : int32_t {
643     RUIM_SIM,
644     NV,
645 };
646
647 enum CdmaRoamingType : int32_t {
648     HOME_NETWORK,
649     AFFILIATED_ROAM,
650     ANY_ROAM,
651 };
652
653 enum TtyMode : int32_t {
654     OFF,
655     FULL,
656     HCO,                                  // Hearing carryover
657     VCO,                                  // Voice carryover
658 };
659
660 enum NvItem : int32_t {
661     // CDMA radio and account information (items 1-10)
662     CDMA_MEID = 1,                       // CDMA MEID (hex)
663     CDMA_MIN = 2,                        // CDMA MIN (MSID)
664     CDMA_MDN = 3,                        // CDMA MDN
665     CDMA_ACCOLC = 4,                     // CDMA access overload control
666
667     // Carrier device provisioning (items 11-30)
668     DEVICE_MSL = 11,                     // device MSL
669     RTN_RECONDITIONED_STATUS = 12,       // RTN reconditioned status
670     RTN_ACTIVATION_DATE = 13,            // RTN activation date
671     RTN_LIFE_TIMER = 14,                 // RTN life timer
672     RTN_LIFE_CALLS = 15,                 // RTN life calls
673     RTN_LIFE_DATA_TX = 16,               // RTN life data TX
674     RTN_LIFE_DATA_RX = 17,               // RTN life data RX
675     OMADM_HFA_LEVEL = 18,                // HFA in progress
676
677     // Mobile IP profile information (items 31-50)
678     MIP_PROFILE_NAI = 31,                // NAI realm
679     MIP_PROFILE_HOME_ADDRESS = 32,       // MIP home address
680     MIP_PROFILE_AAA_AUTH = 33,           // AAA auth
681     MIP_PROFILE_HA_AUTH = 34,            // HA auth
682     MIP_PROFILE_PRI_HA_ADDR = 35,        // primary HA address
683     MIP_PROFILE_SEC_HA_ADDR = 36,        // secondary HA address
684     MIP_PROFILE_REV_TUN_PREF = 37,       // reverse TUN preference
685     MIP_PROFILE_HA_SPI = 38,             // HA SPI
686     MIP_PROFILE_AAA_SPI = 39,            // AAA SPI
687     MIP_PROFILE_MN_HA_SS = 40,           // HA shared secret
688     MIP_PROFILE_MN_AAA_SS = 41,          // AAA shared secret
689
690     // CDMA network and band config (items 51-70)
691     CDMA_PRL_VERSION = 51,               // CDMA PRL version
692     CDMA_BC10 = 52,                      // CDMA band class 10
693     CDMA_BC14 = 53,                      // CDMA band class 14
694     CDMA_SO68 = 54,                      // CDMA SO68
695     CDMA_SO73_COP0 = 55,                 // CDMA SO73 COP0
696     CDMA_SO73_COP1TO7 = 56,              // CDMA SO73 COP1-7
697     CDMA_1X_ADVANCED_ENABLED = 57,       // CDMA 1X Advanced enabled
698     CDMA_EHRPD_ENABLED = 58,             // CDMA eHRPD enabled
699     CDMA_EHRPD_FORCED = 59,              // CDMA eHRPD forced
700
701     // LTE network and band config (items 71-90)
702     LTE_BAND_ENABLE_25 = 71,             // LTE band 25 enable
703     LTE_BAND_ENABLE_26 = 72,             // LTE band 26 enable
704     LTE_BAND_ENABLE_41 = 73,             // LTE band 41 enable
705
706     LTE_SCAN_PRIORITY_25 = 74,           // LTE band 25 scan priority
707     LTE_SCAN_PRIORITY_26 = 75,           // LTE band 26 scan priority
708     LTE_SCAN_PRIORITY_41 = 76,           // LTE band 41 scan priority
709
710     LTE_HIDDEN_BAND_PRIORITY_25 = 77,    // LTE hidden band 25 priority
711     LTE_HIDDEN_BAND_PRIORITY_26 = 78,    // LTE hidden band 26 priority
712     LTE_HIDDEN_BAND_PRIORITY_41 = 79,    // LTE hidden band 41 priority
713 };
714
715 enum ResetNvType : int32_t {
716     RELOAD,                              // reload all NV items
717     ERASE,                               // erase NV reset (SCRTN)
718     FACORY_RESET,                        // factory reset (RTN)
719 };
720
721 enum HardwareConfigType : int32_t {
722     MODEM,
723     SIM,
724 };
725
726 enum HardwareConfigState : int32_t {
727     ENABLED,
728     STANDBY,
729     DISABLED,
730 };
731
732 enum LceStatus : int32_t {
733     NOT_SUPPORTED,
734     STOPPED,
735     ACTIVE
736 };
737
738 enum CarrierMatchType : int32_t {
739     ALL = 0,                               // Apply to all carriers with the same mcc/mnc
740     SPN = 1,                               // Use SPN and mcc/mnc to identify the carrier
741     IMSI_PREFIX = 2,                       // Use IMSI prefix and mcc/mnc to identify the carrier
742     GID1 = 3,                              // Use GID1 and mcc/mnc to identify the carrier
743     GID2 = 4,                              // Use GID2 and mcc/mnc to identify the carrier
744 };
745
746 struct NeighboringCell {
747     string cid;                           // Combination of LAC and Cell Id in 32 bits in GSM.
748                                           // Upper 16 bits is LAC and lower 16 bits
749                                           // is CID (as described in TS 27.005)
750                                           // Primary Scrambling Code (as described in TS 25.331)
751                                           // in 9 bits in UMTS
752                                           // Valid values are hexadecimal 0x0000 - 0xffffffff.
753     int32_t rssi;                         // Received RSSI in GSM,
754                                           // Level index of CPICH Received Signal Code Power in UMTS
755 };
756
757 enum CdmaSmsDigitMode : int32_t {
758     FOUR_BIT,                             // DTMF digits
759     EIGHT_BIT,
760 };
761
762 enum CdmaSmsNumberMode : int32_t {
763     NOT_DATA_NETWORK,
764     DATA_NETWORK,
765 };
766
767 enum CdmaSmsNumberType : int32_t {
768     UNKNOWN,
769     INTERNATIONAL_OR_DATA_IP,             // INTERNATIONAL is used when number mode is not data
770                                           // network
771                                           // address. DATA_IP is used when the number mode is data
772                                           // network address
773     NATIONAL_OR_INTERNET_MAIL,            // NATIONAL is used when the number mode is not data
774                                           // network address. INTERNET_MAIL is used when the number
775                                           // mode is data network address. For INTERNET_MAIL, in
776                                           // the address data "digits", each byte contains an ASCII
777                                           // character.
778                                           // Examples are "x@y.com,a@b.com - ref
779                                           // TIA/EIA-637A 3.4.3.3
780     NETWORK,
781     SUBSCRIBER,
782     ALPHANUMERIC,                         // GSM SMS: address value is GSM 7-bit chars
783     ABBREVIATED,
784     RESERVED_7,
785 };
786
787 enum CdmaSmsNumberPlan : int32_t {
788     UNKNOWN,
789     TELEPHONY,                            // CCITT E.164 and E.163, including ISDN plan
790     RESERVED_2,
791     DATA,                                 // CCITT X.121
792     TELEX,                                // CCITT F.69
793     RESERVED_5,
794     RESERVED_6,
795     RESERVED_7,
796     RESERVED_8,
797     PRIVATE,
798     RESERVED_10,
799     RESERVED_11,
800     RESERVED_12,
801     RESERVED_13,
802     RESERVED_14,
803     RESERVED_15,
804 };
805
806 enum CdmaSmsSubaddressType : int32_t {
807     NSAP,                                // CCITT X.213 or ISO 8348 AD2
808     USER_SPECIFIED,                      // e.g. X.25
809 };
810
811 enum CdmaSmsErrorClass : int32_t {
812     NO_ERROR,
813     ERROR,
814 };
815
816 enum CdmaSmsWriteArgsStatus : int32_t {
817     REC_UNREAD,
818     REC_READ,
819     STO_UNSENT,
820     STO_SENT
821 };
822
823 enum CellInfoType : int32_t {
824     GSM,
825     CDMA,
826     LTE,
827     WCDMA,
828     TD_SCDMA
829 };
830
831 enum TimeStampType : int32_t {
832     UNKNOWN,
833     ANTENNA,
834     MODEM,
835     OEM_RIL,
836     JAVA_RIL,
837 };
838
839 enum ApnAuthType : int32_t {
840     NO_PAP_NO_CHAP,                       // PAP and CHAP is never performed.
841     PAP_NO_CHAP,                          // PAP may be performed; CHAP is never performed.
842     NO_PAP_CHAP,                          // CHAP may be performed; PAP is never performed.
843     PAP_CHAP                              // PAP / CHAP may be performed - baseband dependent.
844 };
845
846 enum RadioTechnologyFamily : int32_t {
847     THREE_GPP,                            // 3GPP Technologies - GSM, WCDMA
848     THREE_GPP2                            // 3GPP2 Technologies - CDMA
849 };
850
851 enum RadioCapabilityPhase : int32_t {
852     CONFIGURED = 0,                      // Logical Modem's (LM)  initial value
853                                          // and value after FINISH completes
854     START      = 1,                      // START is sent before APPLY and indicates that an
855                                          // APPLY is forthcoming with these same parameters
856     APPLY      = 2,                      // APPLY is sent after all LM's receive START and returned
857                                          // RadioCapability.status = 0. If any START's fail, hal
858                                          // implementation must not send APPLY.
859     UNSOL_RSP  = 3,                      // UNSOL_RSP is sent with unsol radioCapability()
860     FINISH     = 4                       // FINISH is sent after all commands have completed. If an
861                                          // error occurs in any previous command, the
862                                          // RadioAccessesFamily and logicalModemUuid fields must be
863                                          // the prior configuration thus restoring the configuration
864                                          // to the previous value. An error returned by FINISH
865                                          // will generally be ignored or may cause that logical
866                                          // modem to be removed from service.
867 };
868
869 enum RadioCapabilityStatus : int32_t {
870     NONE       = 0,                      // This parameter has no meaning with
871                                          // RadioCapabilityPhase:START, RadioCapabilityPhase:APPLY
872     SUCCESS    = 1,                      // Tell modem the action transaction of set radio
873                                          // capability was success with RadioCapabilityPhase:FINISH
874     FAIL       = 2,                      // Tell modem the action transaction of set radio
875                                          // capability is fail with RadioCapabilityPhase:FINISH.
876 };
877
878 enum RadioAccessFamily : int32_t {
879     UNKNOWN = 1 << RadioTechnology:UNKNOWN,
880     GPRS = 1 << RadioTechnology:GPRS,
881     EDGE = 1 << RadioTechnology:EDGE,
882     UMTS = 1 << RadioTechnology:UMTS,
883     IS95A = 1 << RadioTechnology:IS95A,
884     IS95B = 1 << RadioTechnology:IS95B,
885     ONE_X_RTT = 1 << RadioTechnology:ONE_X_RTT,
886     EVDO_0 = 1 << RadioTechnology:EVDO_0,
887     EVDO_A = 1 << RadioTechnology:EVDO_A,
888     HSDPA = 1 << RadioTechnology:HSDPA,
889     HSUPA = 1 << RadioTechnology:HSUPA,
890     HSPA = 1 << RadioTechnology:HSPA,
891     EVDO_B = 1 << RadioTechnology:EVDO_B,
892     EHRPD = 1 << RadioTechnology:EHRPD,
893     LTE = 1 << RadioTechnology:LTE,
894     HSPAP = 1 << RadioTechnology:HSPAP,
895     GSM = 1 << RadioTechnology:GSM,
896     TD_SCDMA = 1 << RadioTechnology:TD_SCDMA,
897     LTE_CA = 1 << RadioTechnology:LTE_CA
898 };
899
900 enum UssdModeType : int32_t {
901     NOTIFY,                                // USSD-Notify
902     REQUEST,                               // USSD-Request
903     NW_RELEASE,                            // Session terminated by network
904     LOCAL_CLIENT,                          // other local client (eg, SIM Toolkit) has responded
905     NOT_SUPPORTED,                         // Operation not supported
906     NW_TIMEOUT,                            // Network timeout
907 };
908
909 enum SimRefreshType : int32_t {
910     SIM_FILE_UPDATE = 0,                   // A file on SIM has been updated.
911     SIM_INIT = 1,                          // SIM initialized. All files should be re-read.
912     SIM_RESET = 2                          // SIM reset. SIM power required, SIM may be locked a
913                                            // nd all files must be re-read.
914 };
915
916 enum SrvccState :int32_t {
917     HANDOVER_STARTED = 0,
918     HANDOVER_COMPLETED = 1,
919     HANDOVER_FAILED = 2,
920     HANDOVER_CANCELED = 3
921 };
922
923 enum UiccSubActStatus : int32_t {
924     DEACTIVATE,
925     ACTIVATE
926 };
927
928 enum SubscriptionType : int32_t {
929     SUBSCRIPTION_1,
930     SUBSCRIPTION_2,
931     SUBSCRIPTION_3
932 };
933
934 enum DataProfileInfoType : int32_t {
935     COMMON,
936     THREE_GPP,
937     THREE_GPP2
938 };
939
940 enum PhoneRestrictedState : int32_t {
941     NONE = 0x00,                           // No restriction at all including voice/SMS/USSD/SS/AV64
942                                            // and packet data
943     CS_EMERGENCY = 0x01,                   // Block emergency call due to restriction. But allow all
944                                            // normal voice/SMS/USSD/SS/AV64.
945     CS_NORMAL = 0x02,                      // Block all normal voice/SMS/USSD/SS/AV64 due to
946                                            // restriction. Only Emergency call allowed.
947     CS_ALL = 0x04,                         // Block all voice/SMS/USSD/SS/AV64 including emergency
948                                            // call due to restriction.
949     PS_ALL = 0x10                          // Block packet data access due to restriction.
950 };
951
952 enum CdmaCallWaitingNumberPresentation : int32_t {
953     ALLOWED = 0,
954     RESTRICTED = 1,
955     UNKNOWN = 2,
956 };
957
958 enum CdmaCallWaitingNumberType : int32_t {
959     UNKNOWN = 0,
960     INTERNATIONAL = 1,
961     NATIONAL = 2,
962     NETWORK_SPECIFIC = 3,
963     SUBSCRIBER = 4
964 };
965
966 enum CdmaCallWaitingNumberPlan : int32_t {
967     UNKNOWN = 0,
968     ISDN = 1,
969     DATA = 3,
970     TELEX = 4,
971     NATIONAL = 8,
972     PRIVATE = 9
973 };
974
975 enum CdmaOtaProvisionStatus : int32_t {
976     SPL_UNLOCKED,
977     SPC_RETRIES_EXCEEDED,
978     A_KEY_EXCHANGED,
979     SSD_UPDATED,
980     NAM_DOWNLOADED,
981     MDN_DOWNLOADED,
982     IMSI_DOWNLOADED,
983     PRL_DOWNLOADED,
984     COMMITTED,
985     OTAPA_STARTED,
986     OTAPA_STOPPED,
987     OTAPA_ABORTED
988 };
989
990 /* Names of the CDMA info records (C.S0005 section 3.7.5) */
991 enum CdmaInfoRecName : int32_t {
992     DISPLAY,
993     CALLED_PARTY_NUMBER,
994     CALLING_PARTY_NUMBER,
995     CONNECTED_NUMBER,
996     SIGNAL,
997     REDIRECTING_NUMBER,
998     LINE_CONTROL,
999     EXTENDED_DISPLAY,
1000     T53_CLIR,
1001     T53_RELEASE,
1002     T53_AUDIO_CONTROL
1003 };
1004
1005 /* Redirecting Number Information Record as defined in C.S0005 section 3.7.5.11 */
1006 enum CdmaRedirectingReason : int32_t {
1007     UNKNOWN = 0,
1008     CALL_FORWARDING_BUSY = 1,
1009     CALL_FORWARDING_NO_REPLY = 2,
1010     CALLED_DTE_OUT_OF_ORDER = 9,
1011     CALL_FORWARDING_BY_THE_CALLED_DTE = 10,
1012     CALL_FORWARDING_UNCONDITIONAL = 15,
1013     RESERVED
1014 };
1015
1016 enum SsServiceType : int32_t {
1017     CFU,
1018     CF_BUSY,
1019     CF_NO_REPLY,
1020     CF_NOT_REACHABLE,
1021     CF_ALL,
1022     CF_ALL_CONDITIONAL,
1023     CLIP,
1024     CLIR,
1025     COLP,
1026     COLR,
1027     WAIT,
1028     BAOC,
1029     BAOIC,
1030     BAOIC_EXC_HOME,
1031     BAIC,
1032     BAIC_ROAMING,
1033     ALL_BARRING,
1034     OUTGOING_BARRING,
1035     INCOMING_BARRING
1036 };
1037
1038 enum SsRequestType : int32_t {
1039     ACTIVATION,
1040     DEACTIVATION,
1041     INTERROGATION,
1042     REGISTRATION,
1043     ERASURE
1044 };
1045
1046 enum SsTeleserviceType : int32_t {
1047     ALL_TELE_AND_BEARER_SERVICES,
1048     ALL_TELESEVICES,
1049     TELEPHONY,
1050     ALL_DATA_TELESERVICES,
1051     SMS_SERVICES,
1052     ALL_TELESERVICES_EXCEPT_SMS
1053 };
1054
1055 enum SuppServiceClass : int32_t {
1056     NONE = 0,
1057     VOICE = 1 << 0,
1058     DATA = 1 << 1,
1059     FAX = 1 << 2,
1060     SMS = 1 << 3,
1061     DATA_SYNC = 1 << 4,
1062     DATA_ASYNC = 1 << 5,
1063     PACKET = 1 << 6,
1064     PAD = 1 << 7,
1065     MAX = 1 << 7
1066 };
1067
1068 struct RadioResponseInfo {
1069     RadioResponseType type;               // Response type
1070     int32_t serial;                       // Serial number of the request
1071     RadioError error;                     // Response error
1072 };
1073
1074 struct AppStatus {
1075     AppType appType;
1076     AppState appState;
1077     PersoSubstate persoSubstate;          // applicable only if app_state == SUBSCRIPTION_PERSO
1078     string aidPtr;                        // e.g., from 0xA0, 0x00 -> 0x41,
1079                                           // 0x30, 0x30, 0x30
1080     string appLabelPtr;
1081     int32_t pin1Replaced;                 // applicable to USIM, CSIM and ISIM
1082     PinState pin1;
1083     PinState pin2;
1084 };
1085
1086 struct CardStatus {
1087     CardState cardState;
1088     PinState universalPinState;           // applicable to USIM and CSIM
1089     int32_t gsmUmtsSubscriptionAppIndex;  // value < RadioConst:CARD_MAX_APPS, -1 if none
1090     int32_t cdmaSubscriptionAppIndex;     // value < RadioConst:CARD_MAX_APPS, -1 if none
1091     int32_t imsSubscriptionAppIndex;      // value < RadioConst:CARD_MAX_APPS, -1 if none
1092     int32_t numApplications;              // value <= RadioConst:CARD_MAX_APPS
1093     AppStatus[RadioConst:CARD_MAX_APPS] applications;
1094 };
1095
1096 /*
1097  * User-to-User Signaling Information defined in 3GPP 23.087 v8.0
1098  */
1099 struct UusInfo {
1100     UusType uusType;                      // UUS Type
1101     UusDcs uusDcs;                        // UUS Data Coding Scheme
1102     string uusData;                       // UUS data
1103 };
1104
1105 struct Call {
1106     CallState state;
1107     int32_t index;                        // Connection Index for use with, eg, AT+CHLD
1108     int32_t toa;                          // type of address, eg 145 = intl
1109     bool isMpty;                          // true if is mpty call
1110     bool isMT;                            // true if call is mobile terminated
1111     uint8_t als;                          // ALS line indicator if available (0 = line 1)
1112     bool isVoice;                         // true if this is is a voice call
1113     bool isVoicePrivacy;                  // true if CDMA voice privacy mode is active
1114     string number;                        // Remote party number
1115     CallPresentation numberPresentation;
1116     string name;                          // Remote party name
1117     CallPresentation namePresentation;
1118     vec<UusInfo> uusInfo;                 // Vector of User-User Signaling Information
1119 };
1120
1121 struct Dial {
1122     string address;
1123     Clir clir;
1124     vec<UusInfo> uusInfo;                 // Vector of User-User Signaling Information
1125 };
1126
1127 struct LastCallFailCauseInfo {
1128     LastCallFailCause causeCode;
1129     string vendorCause;
1130 };
1131
1132 struct GsmSignalStrength {
1133     uint32_t signalStrength;              // Valid values are (0-61, 99) as defined in
1134                                           // TS 27.007 8.69
1135     uint32_t bitErrorRate;                // bit error rate (0-7, 99) as defined in TS 27.007 8.5
1136     int32_t timingAdvance;                // Timing Advance in bit periods. 1 bit period = 48/13 us.
1137                                           // INT_MAX denotes invalid value
1138 };
1139
1140 struct WcdmaSignalStrength{
1141     int32_t signalStrength;               // Valid values are (0-96, 99) as defined in
1142                                           // TS 27.007 8.69
1143     int32_t bitErrorRate;                 // bit error rate (0-49, 99) as defined in TS 27.007 8.69
1144 };
1145
1146 struct CdmaSignalStrength {
1147     uint32_t dbm;                         // This value is the actual RSSI
1148                                           // value multiplied by -1. Example: If the
1149                                           // actual RSSI is -75, then this response value will
1150                                           // be 75.
1151     uint32_t ecio;                        // This value is the actual
1152                                           // Ec/Io multiplied by -10. Example: If the
1153                                           // actual Ec/Io is -12.5 dB, then this response value
1154                                           // will be 125.
1155 };
1156
1157 struct EvdoSignalStrength {
1158     uint32_t dbm;                         // This value is the actual
1159                                           // RSSI value multiplied by -1.
1160                                           // Example: If the actual RSSI is -75,
1161                                           // then this response value will be 75.
1162     uint32_t ecio;                        // This value is the actual
1163                                           // Ec/Io multiplied by -10. Example: If the
1164                                           // actual Ec/Io is -12.5 dB, then this response value
1165                                           // will be 125.
1166     uint32_t signalNoiseRatio;            // Valid values are 0-8. 8 is the highest signal to
1167                                           // noise ratio.
1168 };
1169
1170 struct LteSignalStrength {
1171     uint32_t signalStrength;              // Valid values are (0-31, 99) as defined in
1172                                           // TS 27.007 8.5
1173     uint32_t rsrp;                        // The current Reference Signal Receive Power in dBm
1174                                           // multipled by -1.
1175                                           // Range: 44 to 140 dBm
1176                                           // INT_MAX: 0x7FFFFFFF denotes invalid value.
1177                                           // Reference: 3GPP TS 36.133 9.1.4
1178     uint32_t rsrq;                        // The current Reference Signal Receive Quality in dB
1179                                           // multiplied by -1.
1180                                           // Range: 20 to 3 dB.
1181                                           // INT_MAX: 0x7FFFFFFF denotes invalid value.
1182                                           // Reference: 3GPP TS 36.133 9.1.7
1183     int32_t rssnr;                        // The current reference signal signal-to-noise ratio in
1184                                           // 0.1 dB units.
1185                                           // Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB).
1186                                           // INT_MAX : 0x7FFFFFFF denotes invalid value.
1187                                           // Reference: 3GPP TS 36.101 8.1.1
1188     uint32_t cqi;                         // The current Channel Quality Indicator.
1189                                           // Range: 0 to 15.
1190                                           // INT_MAX : 0x7FFFFFFF denotes invalid value.
1191                                           // Reference: 3GPP TS 36.101 9.2, 9.3, A.4
1192     uint32_t timingAdvance;               // timing advance in micro seconds for a one way trip
1193                                           // from cell to device.
1194                                           // Approximate distance is calculated using
1195                                           // 300m/us * timingAdvance.
1196                                           // Range: 0 to 0x7FFFFFFE
1197                                           // INT_MAX : 0x7FFFFFFF denotes invalid value.
1198                                           // Reference: 3GPP 36.321 section 6.1.3.5
1199                                           // also: http://www.cellular-planningoptimization.com/2010/02/timing-advance-with-calculation.html
1200 };
1201
1202 struct TdScdmaSignalStrength {
1203     uint32_t rscp;                        // The Received Signal Code Power in dBm multipled by -1.
1204                                           // Range : 25 to 120
1205                                           // INT_MAX: 0x7FFFFFFF denotes invalid value.
1206                                           // Reference: 3GPP TS 25.123, section 9.1.1.1
1207 };
1208
1209 struct SignalStrength {
1210     GsmSignalStrength gw;
1211     CdmaSignalStrength cdma;
1212     EvdoSignalStrength evdo;
1213     LteSignalStrength lte;
1214     TdScdmaSignalStrength tdScdma;
1215 };
1216
1217 struct SendSmsResult {
1218     int32_t messageRef;                   // TP-Message-Reference for GSM, and BearerData MessageId
1219                                           // for CDMA (See 3GPP2 C.S0015-B, v2.0, table 4.5-1)
1220     string ackPDU;                        // or empty string if n/a
1221     int32_t errorCode;                    // See 3GPP 27.005, 3.2.5 for GSM/UMTS,
1222                                           // 3GPP2 N.S0005 (IS-41C) Table 171 for CDMA,
1223                                           // -1 if unknown or not applicable
1224 };
1225
1226 struct SetupDataCallResult {
1227     int32_t status;                       // A RadioDataCallFailCause, 0 which is
1228                                           // RadioDataCallFailCause:NONE if no error
1229     int32_t suggestedRetryTime;           // If status != 0, this fields indicates the suggested
1230                                           // retry back-off timer value RIL wants to override the
1231                                           // one pre-configured in FW.
1232                                           // The unit is miliseconds.
1233                                           // The value < 0 means no value is suggested.
1234                                           // The value 0 means retry must be done ASAP.
1235                                           // The value of INT_MAX(0x7fffffff) means no retry.
1236     int32_t cid;                          // Context ID, uniquely identifies this call
1237     int32_t active;                       // 0=inactive, 1=active/physical link down,
1238                                           // 2=active/physical link up */
1239     string type;                          // One of the PDP_type values in TS 27.007 section 10.1.1.
1240                                           // For example, "IP", "IPV6", "IPV4V6", or "PPP". If
1241                                           // status is
1242                                           // RadioDataCallFailCause:ONLY_SINGLE_BEARER_ALLOWED this
1243                                           // is the type supported such as "IP" or "IPV6"
1244     string ifname;                        // The network interface name
1245     string addresses;                     // A space-delimited list of addresses with optional "/"
1246                                           // prefix length, e.g., "192.0.1.3" or
1247                                           // "192.0.1.11/16 2001:db8::1/64".
1248                                           // Typically 1 IPv4 or 1 IPv6 or
1249                                           // one of each. If the prefix length is absent the
1250                                           // addresses are assumed to be point to point with IPv4
1251                                           // having a prefix length of 32 and IPv6 128.
1252     string dnses;                         // A space-delimited list of DNS server addresses,
1253                                           // e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
1254                                           // Empty if no dns server addresses returned.
1255     string gateways;                      // A space-delimited list of default gateway addresses,
1256                                           // e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
1257                                           // When empty, the addresses represent
1258                                           // point to point connections.
1259     string pcscf;                         // the Proxy Call State Control Function address
1260                                           // via PCO(Protocol Configuration Option) for IMS client.
1261     int32_t mtu;                          // MTU received from network
1262                                           // Value <= 0 means network has either not sent a
1263                                           // value or sent an invalid value
1264 };
1265
1266 struct IccIo {
1267     int32_t command;                      // one of the commands listed for TS 27.007 +CRSM
1268     int32_t fileId;                       // EF id
1269     string path;                          // "pathid" from TS 27.007 +CRSM command.
1270                                           // Path is in hex asciii format eg "7f205f70"
1271                                           // Path must always be provided.
1272     int32_t p1;                           // Values of p1, p2 and p3 defined as per 3GPP TS 51.011
1273     int32_t p2;
1274     int32_t p3;
1275     string data;                          // information to be written to the SIM
1276     string pin2;
1277     string aid;                           // AID value, See ETSI 102.221 8.1 and 101.220 4, empty
1278                                           // string if no value.
1279 };
1280
1281 struct IccIoResult {
1282     int32_t sw1;
1283     int32_t sw2;
1284     string simResponse;                   // In hex string format ([a-fA-F0-9]*), except for
1285                                           // SIM_AUTHENTICATION response for which it is in
1286                                           // Base64 format, see 3GPP TS 31.102 7.1.2
1287 };
1288
1289 struct VoiceRegStateResult {
1290     RegState regState;
1291     int32_t lac;                          // LAC if registered on a GSM/WCDMA system or
1292                                           // -1 if not.Valid LAC are 0x0000 - 0xffff
1293     int32_t cid;                          // CID. if registered on a * GSM/WCDMA or -1 if not
1294                                           // Valid CID are 0x00000000 - 0xffffffff
1295                                           // In GSM, CID is Cell ID (see TS 27.007) in 16 bits
1296                                           // In UMTS, CID is UMTS Cell Identity (see TS 25.331)
1297                                           // in 28 bits
1298     int32_t rat;                          // indicates the available voice radio technology,
1299                                           // valid values as defined by RIL_RadioTechnology.
1300     int32_t baseStationId;                // Base Station ID. if registered on a CDMA
1301                                           // system or -1 if not. Base Station ID in decimal format
1302     int32_t baseStationLatitude;          // Base Station latitude. if registered on a
1303                                           // CDMA system or -1 if not. Base Station latitude is a
1304                                           // decimal number as specified in 3GPP2 C.S0005-A v6.0.
1305                                           // It is represented in units of 0.25 seconds and ranges
1306                                           // from -1296000 to 1296000, both values inclusive
1307                                           // (corresponding to a range of -90 to +90 degrees).
1308     int32_t baseStationLongitude;         // Base Station longitude. if registered on a
1309                                           // CDMA system or -1 if not. Base Station
1310                                           // longitude is a decimal number as specified in
1311                                           // 3GPP2 C.S0005-A v6.0. It is represented in
1312                                           // units of 0.25 seconds and ranges from -2592000
1313                                           // to 2592000, both values inclusive (corresponding
1314                                           // to a range of -180 to +180 degrees).
1315     bool cssSupported;                    // concurrent services support indicator. if
1316                                           // registered on a CDMA system.
1317                                           // false - Concurrent services not supported,
1318                                           // true - Concurrent services supported
1319     int32_t systemId;                     // System ID. if registered on a CDMA system or
1320                                           // -1 if not. Valid System ID are 0 - 32767
1321     int32_t networkId;                    // Network ID. if registered on a CDMA system or
1322                                           // -1 if not. Valid System ID are 0 - 65535
1323     int32_t roamingIndicator;             // TSB-58 Roaming Indicator if registered
1324                                           // on a CDMA or EVDO system or -1 if not.
1325                                           // Valid values are 0-255.
1326     int32_t systemIsInPrl;                // indicates whether the current system is in the
1327                                           // PRL if registered on a CDMA or EVDO system or -1 if
1328                                           // not. 0=not in the PRL, 1=in the PRL
1329     int32_t defaultRoamingIndicator;      // default Roaming Indicator from the PRL,
1330                                           // if registered on a CDMA or EVDO system or -1 if not.
1331                                           // Valid values are 0-255.
1332     int32_t reasonForDenial;              // reasonForDenial if registration state is 3
1333                                           // (Registration denied) this is an enumerated reason why
1334                                           // registration was denied. See 3GPP TS 24.008,
1335                                           // 10.5.3.6 and Annex G.
1336                                           // 0 - General
1337                                           // 1 - Authentication Failure
1338                                           // 2 - IMSI unknown in HLR
1339                                           // 3 - Illegal MS
1340                                           // 4 - Illegal ME
1341                                           // 5 - PLMN not allowed
1342                                           // 6 - Location area not allowed
1343                                           // 7 - Roaming not allowed
1344                                           // 8 - No Suitable Cells in this Location Area
1345                                           // 9 - Network failure
1346                                           // 10 - Persistent location update reject
1347                                           // 11 - PLMN not allowed
1348                                           // 12 - Location area not allowed
1349                                           // 13 - Roaming not allowed in this Location Area
1350                                           // 15 - No Suitable Cells in this Location Area
1351                                           // 17 - Network Failure
1352                                           // 20 - MAC Failure
1353                                           // 21 - Sync Failure
1354                                           // 22 - Congestion
1355                                           // 23 - GSM Authentication unacceptable
1356                                           // 25 - Not Authorized for this CSG
1357                                           // 32 - Service option not supported
1358                                           // 33 - Requested service option not subscribed
1359                                           // 34 - Service option temporarily out of order
1360                                           // 38 - Call cannot be identified
1361                                           // 48-63 - Retry upon entry into a new cell
1362                                           // 95 - Semantically incorrect message
1363                                           // 96 - Invalid mandatory information
1364                                           // 97 - Message type non-existent or not implemented
1365                                           // 98 - Message type not compatible with protocol state
1366                                           // 99 - Information element non-existent or not implemented
1367                                           // 100 - Conditional IE error
1368                                           // 101 - Message not compatible with protocol state
1369                                           // 111 - Protocol error, unspecified
1370     int32_t psc;                          // Primary Scrambling Code of the current
1371                                           // cell as described in TS 25.331, in hexadecimal
1372                                           // format, or -1 if unknown or not registered
1373                                           // to a UMTS network.
1374 };
1375
1376 struct DataRegStateResult {
1377     RegState regState;                    // Valid reg states are NOT_REG_MT_NOT_SEARCHING_OP,
1378                                           // REG_HOME, NOT_REG_MT_SEARCHING_OP, REG_DENIED,
1379                                           // UNKNOWN, REG_ROAMING defined in RegState
1380     int32_t lac;                          // LAC if registered or -1 if not
1381                                           // valid LAC are 0x0000 - 0xffff
1382     int32_t cid;                          // CID if registered or -1 if not
1383                                           // valid CID are 0x00000000 - 0x0fffffff
1384     int32_t rat;                          // indicates the available data radio technology,
1385                                           // valid values as defined by RIL_RadioTechnology.
1386     int32_t reasonDataDenied;             // if registration state is 3 (Registration
1387                                           // denied) this is an enumerated reason why
1388                                           // registration was denied. See 3GPP TS 24.008,
1389                                           // Annex G.6 "Additonal cause codes for GMM".
1390                                           // 7 == GPRS services not allowed
1391                                           // 8 == GPRS services and non-GPRS services not allowed
1392                                           // 9 == MS identity cannot be derived by the network
1393                                           // 10 == Implicitly detached
1394                                           // 14 == GPRS services not allowed in this PLMN
1395                                           // 16 == MSC temporarily not reachable
1396                                           // 40 == No PDP context activated
1397     int32_t maxDataCalls;                 // The maximum number of simultaneous Data Calls that
1398                                           // must be established using setupDataCall().
1399     // The values below are optional LTE location information in decimal.
1400     // If a value is unknown that value must be -1.
1401     int32_t tac;                          // a 16-bit Tracking Area Code.
1402     int32_t phyCid;                       // a 0-503 Physical Cell Identifier.
1403     int32_t eci;                          // a 28-bit E-UTRAN Cell Identifier.
1404     int32_t csgid;                        // a 27-bit Closed Subscriber Group Identity.
1405     int32_t tadv;                         // a 6-bit timing advance value.
1406 };
1407
1408 // See also com.android.internal.telephony.gsm.CallForwardInfo
1409 struct CallForwardInfo {
1410     CallForwardInfoStatus status;         // For queryCallForwardStatus()
1411                                           // status is DISABLE (Not used by vendor code currently)
1412                                           // For setCallForward():
1413                                           // status must be
1414                                           // DISABLE, ENABLE, INTERROGATE, REGISTRATION, ERASURE
1415     int32_t reason;                       // from TS 27.007 7.11 "reason"
1416     int32_t serviceClass;                 // From 27.007 +CCFC/+CLCK "class"
1417                                           // See table for Android mapping from
1418                                           // MMI service code
1419                                           // 0 means user doesnt input class
1420     int32_t toa;                          // "type" from TS 27.007 7.11
1421     string number;                        // "number" from TS 27.007 7.11.
1422     int32_t timeSeconds;
1423 };
1424
1425 // Response struct used in responseQueryAvailableNetworks
1426 struct OperatorInfo {
1427     string alphaLong;                     // long alpha ONS or EONS
1428     string alphaShort;                    // short alpha ONS or EONS
1429     string operatorNumeric;               // 5 or 6 digit numeric code (MCC + MNC)
1430     OperatorStatus status;
1431 };
1432
1433 struct SmsWriteArgs {
1434     SmsWriteArgsStatus status;            // Status of message. See TS 27.005 3.1
1435     string pdu;                           // PDU of message to write, as an ASCII hex string less
1436                                           // the SMSC address, the TP-layer length is strlen(pdu)/2.
1437     string smsc;                          // SMSC address in GSM BCD format prefixed by a length
1438                                           // byte (as expected by TS 27.005) or NULL for default
1439                                           // SMSC
1440 };
1441
1442 struct CdmaSmsAddress {
1443     CdmaSmsDigitMode digitMode;          // CdmaSmsDigitMode is of two types : 4 bit and 8 bit.
1444                                          // For 4-bit type, only "digits" field defined below in
1445                                          // this struct is used.
1446     CdmaSmsNumberMode numberMode;        // Used only when digitMode is 8-bit
1447     CdmaSmsNumberType numberType;        // Used only when digitMode is 8-bit.
1448                                          // To specify an international address, use the following:
1449                                          // digitMode = CdmaSmsDigitMode:EIGHT_BIT:
1450                                          // numberMode = CdmaSmsNumberMode:NOT_DATA_NETWORK
1451                                          // numberType = CdmaSmsNumberType:INTERNATIONAL_OR_DATA_IP
1452                                          // numberPlan = CdmaSmsNumberPlan:TELEPHONY
1453                                          // numberOfDigits = number of digits
1454                                          // digits = ASCII digits, e.g. '1', '2', '3', '4', and '5'
1455     CdmaSmsNumberPlan numberPlan;        // Used only when digitMode is 8-bit
1456     vec<uint8_t> digits;                 // Each byte in this array represents a 4 bit or 8-bit digit
1457                                          // of address data
1458 };
1459
1460 struct CdmaSmsSubaddress {
1461     CdmaSmsSubaddressType subaddressType;
1462     bool odd;                            // true means the last byte's lower 4 bits must be ignored
1463     vec<uint8_t> digits;                 // Each byte respresents an 8-bit digit of subaddress data
1464 };
1465
1466 struct CdmaSmsMessage {
1467     int32_t teleserviceId;
1468     bool isServicePresent;
1469     int32_t serviceCategory;
1470     CdmaSmsAddress address;
1471     CdmaSmsSubaddress subAddress;
1472     vec<uint8_t> bearerData;             // 3GPP2 C.S0015-B, v2.0,
1473 };
1474
1475 struct CdmaSmsAck {
1476     CdmaSmsErrorClass errorClass;
1477     int32_t smsCauseCode;                // As defined in N.S00005, 6.5.2.125.
1478                                          // Currently, only 35 (resource shortage) and
1479                                          // 39 (other terminal problem) are reported.
1480 };
1481
1482 struct CdmaBroadcastSmsConfigInfo {
1483     int32_t serviceCategory;             // serviceCategory defines a Broadcast message identifier
1484                                          // whose value is 0x0000 - 0xFFFF as defined in
1485                                          // C.R1001G 9.3.1 and 9.3.2.
1486     int32_t language;                    // language code of Broadcast Message
1487                                          // whose value is 0x00 - 0x07 as defined in C.R1001G 9.2.
1488     bool selected;                       // selected false means message types specified in
1489                                          // serviceCategory are not accepted, while true means
1490                                          // accepted.
1491 };
1492
1493 struct CdmaSmsWriteArgs {
1494     CdmaSmsWriteArgsStatus status;       // Status of message. See TS 27.005 3.1
1495     CdmaSmsMessage message;
1496 };
1497
1498
1499 /**
1500  * Which types of Cell Broadcast Message (CBM) are to be received by the ME
1501  *
1502  * fromServiceID - uToServiceID defines a range of CBM message identifiers
1503  * whose value is 0x0000 - 0xFFFF as defined in TS 23.041 9.4.1.2.2 for GMS
1504  * and 9.4.4.2.2 for UMTS. All other values must be treated as empty
1505  * CBM message ID.
1506  *
1507  * fromCodeScheme - uToCodeScheme defines a range of CBM data coding schemes
1508  * whose value is 0x00 - 0xFF as defined in TS 23.041 9.4.1.2.3 for GMS
1509  * and 9.4.4.2.3 for UMTS.
1510  * All other values must be treated as empty CBM data coding scheme.
1511  *
1512  * selected false means message types specified in <fromServiceId, toServiceId>
1513  * and <fromCodeScheme, toCodeScheme>are not accepted, while true means accepted.
1514  */
1515 struct GsmBroadcastSmsConfigInfo {
1516     int32_t fromServiceId;
1517     int32_t toServiceId;
1518     int32_t fromCodeScheme;
1519     int32_t toCodeScheme;
1520     bool selected;
1521 };
1522
1523 struct CellIdentityGsm {
1524     string mcc;                          // 3-digit Mobile Country Code, 0..999, INT_MAX if unknown
1525     string mnc;                          // 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if
1526                                          // unknown
1527     int32_t lac;                         // 16-bit Location Area Code, 0..65535, INT_MAX if unknown
1528     int32_t cid;                         // 16-bit GSM Cell Identity described in
1529                                          // TS 27.007, 0..65535, INT_MAX if unknown
1530     int32_t arfcn;                       // 16-bit GSM Absolute RF channel number, INT_MAX if
1531                                          // unknown
1532     uint8_t bsic;                        // 6-bit Base Station Identity Code, 0xFF if unknown
1533 };
1534
1535 struct CellIdentityWcdma {
1536     string mcc;                          // 3-digit Mobile Country Code, 0..999, INT_MAX if unknown
1537     string mnc;                          // 2 or 3-digit Mobile Network Code, 0..999, INT_MAX
1538                                          // if unknown
1539     int32_t lac;                         // 16-bit Location Area Code, 0..65535, INT_MAX if unknown
1540     int32_t cid;                         // 28-bit UMTS Cell Identity described in
1541                                          // TS 25.331, 0..268435455, INT_MAX if unknown
1542     int32_t psc;                         // 9-bit UMTS Primary Scrambling Code described in
1543                                          // TS 25.331, 0..511, INT_MAX if unknown
1544     int32_t uarfcn;                      // 16-bit UMTS Absolute RF Channel Number, INT_MAX if
1545                                          // unknown
1546 };
1547
1548 struct CellIdentityCdma {
1549     int32_t networkId;                   // Network Id 0..65535, INT_MAX if unknown
1550     int32_t systemId;                    // CDMA System Id 0..32767, INT_MAX if unknown
1551     int32_t basestationId;               // Base Station Id 0..65535, INT_MAX if unknown
1552     int32_t longitude;                   // Longitude is a decimal number as specified in
1553                                          // 3GPP2 C.S0005-A v6.0. It is represented in units of
1554                                          // 0.25 seconds and ranges from -2592000 to 2592000,
1555                                          // both values inclusive (corresponding to a range of -180
1556                                          // to +180 degrees). INT_MAX if unknown
1557     int32_t latitude;                    // Latitude is a decimal number as specified in
1558                                          // 3GPP2 C.S0005-A v6.0. It is represented in units of
1559                                          // 0.25 seconds and ranges from -1296000 to 1296000,
1560                                          // both values inclusive (corresponding to a range of -90
1561                                          // to +90 degrees). INT_MAX if unknown
1562 };
1563
1564 struct CellIdentityLte {
1565     string mcc;                          // 3-digit Mobile Country Code, 0..999, INT_MAX if unknown
1566     string mnc;                          // 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if
1567                                          // unknown
1568     int32_t ci;                          // 28-bit Cell Identity described in TS TS 27.007, INT_MAX
1569                                          // if unknown
1570     int32_t pci;                         // physical cell id 0..503, INT_MAX if unknown
1571     int32_t tac;                         // 16-bit tracking area code, INT_MAX if unknown
1572     int32_t earfcn;                      // 18-bit LTE Absolute RC Channel Number, INT_MAX if
1573                                          // unknown
1574 };
1575
1576 struct CellIdentityTdscdma {
1577     string mcc;                          // 3-digit Mobile Country Code, 0..999, INT_MAX if unknown
1578     string mnc;                          // 2 or 3-digit Mobile Network Code, 0..999, INT_MAX if
1579                                          // unknown
1580     int32_t lac;                         // 16-bit Location Area Code, 0..65535, INT_MAX if
1581                                          // unknown
1582     int32_t cid;                         // 28-bit UMTS Cell Identity described in
1583                                          // TS 25.331, 0..268435455, INT_MAX if unknown
1584     int32_t cpid;                        // 8-bit Cell Parameters ID described in
1585                                          // TS 25.331, 0..127, INT_MAX if unknown
1586 };
1587
1588 struct CellInfoGsm {
1589     CellIdentityGsm cellIdentityGsm;
1590     GsmSignalStrength signalStrengthGsm;
1591 };
1592
1593 struct CellInfoWcdma {
1594     CellIdentityWcdma cellIdentityWcdma;
1595     WcdmaSignalStrength signalStrengthWcdma;
1596 };
1597
1598 struct CellInfoCdma {
1599     CellIdentityCdma cellIdentityCdma;
1600     CdmaSignalStrength signalStrengthCdma;
1601     EvdoSignalStrength signalStrengthEvdo;
1602 };
1603
1604 struct CellInfoLte {
1605     CellIdentityLte cellIdentityLte;
1606     LteSignalStrength signalStrengthLte;
1607 };
1608
1609 struct CellInfoTdscdma {
1610     CellIdentityTdscdma cellIdentityTdscdma;
1611     TdScdmaSignalStrength signalStrengthTdscdma;
1612 };
1613
1614 struct CellInfo {
1615     CellInfoType cellInfoType;           // cell type for selecting from union CellInfo
1616     bool registered;                     // true if this cell is registered false if not registered
1617     TimeStampType timeStampType;         // type of time stamp represented by timeStamp
1618     uint64_t timeStamp;                  // Time in nanos as returned by ril_nano_time
1619     // Only one of the below vectors must be of size 1 based on the CellInfoType and others must be
1620     // of size 0
1621     vec<CellInfoGsm> gsm;                // Valid only if type = gsm and size = 1 else must be empty
1622     vec<CellInfoCdma> cdma;              // Valid only if type = cdma and size = 1 else must be
1623                                          // empty
1624     vec<CellInfoLte> lte;                // Valid only if type = lte and size = 1 else must be
1625                                          // empty
1626     vec<CellInfoWcdma> wcdma;            // Valid only if type = wcdma and size = 1 else must be
1627                                          // empty
1628     vec<CellInfoTdscdma> tdscdma;        // Valid only if type = tdscdma and size = 1 else must be
1629                                          // empty
1630 };
1631
1632 struct GsmSmsMessage {
1633     string smscPdu;                      // SMSC address in GSM BCD format prefixed by a length
1634                                          // byte (as expected by TS 27.005) or empty string for
1635                                          // default SMSC
1636     string pdu;                          // SMS in PDU format as an ASCII hex string less the
1637                                          // SMSC address. TP-Layer-Length is be "strlen(pdu)/2
1638 };
1639
1640 struct ImsSmsMessage {
1641     RadioTechnologyFamily tech;
1642     bool retry;                          // false == not retry, true == retry */
1643     int32_t messageRef;                  // Valid field if retry is set to true.
1644                                          // Contains messageRef from SendSmsResult stuct
1645                                          // corresponding to failed MO SMS.
1646     // Only one of the below vectors must be of size 1 based on the RadioTechnologyFamily and others
1647     // must be of size 0
1648     vec<CdmaSmsMessage> cdmaMessage;     // Valid field if tech is 3GPP2 and size = 1 else must be
1649                                          // empty
1650     vec<GsmSmsMessage> gsmMessage;       // Valid field if tech is 3GPP and size = 1 else must be
1651                                          // empty
1652 };
1653
1654 struct SimApdu {
1655     int32_t sessionId;                   // "sessionid" from TS 27.007 +CGLA command. Must be
1656                                          // ignored for +CSIM command.
1657     // Following fields are used to derive the APDU ("command" and "length"
1658     // values in TS 27.007 +CSIM and +CGLA commands).
1659     int32_t cla;
1660     int32_t instruction;
1661     int32_t p1;
1662     int32_t p2;
1663     int32_t p3;                          // A negative P3 implies a 4 byte APDU.
1664     string data;                         // In hex string format ([a-fA-F0-9]*).
1665 };
1666
1667 struct NvWriteItem {
1668     NvItem itemId;
1669     string value;
1670 };
1671
1672 struct SelectUiccSub {
1673     int32_t slot;
1674     int32_t appIndex;                   // array subscriptor from
1675                                         // applications[RadioConst:CARD_MAX_APPS] in
1676                                         // getIccCardStatus()
1677     SubscriptionType subType;
1678     UiccSubActStatus actStatus;
1679 };
1680
1681 struct HardwareConfigModem {
1682     int32_t rilModel;
1683     uint32_t rat;                       // bitset - ref. RadioTechnology.
1684     int32_t maxVoice;
1685     int32_t maxData;
1686     int32_t maxStandby;
1687 };
1688
1689 struct HardwareConfigSim {
1690     string modemUuid;                   // RadioConst:MAX_UUID_LENGTH is max length of the
1691                                         // string
1692 };
1693
1694 struct HardwareConfig {
1695     HardwareConfigType type;
1696     string uuid;                         // RadioConst:MAX_UUID_LENGTH is max length of the
1697                                          // string
1698     HardwareConfigState state;
1699     // Only one of the below vectors must have size = 1 based on the HardwareConfigType and other
1700     // must have size = 0.
1701     vec<HardwareConfigModem> modem;      // Valid only if type is Modem and size = 1 else must be
1702                                          // empty
1703     vec<HardwareConfigSim> sim;          // Valid only if type is SIM or else emptyand size = 1
1704                                          // else must be empty
1705 };
1706
1707 struct DataProfileInfo {
1708     int32_t profileId;                   // id of the data profile
1709     string apn;                          // The APN to connect to
1710     string protocol;                     // One of the PDP_type values in TS 27.007 section 10.1.1.
1711                                          // For example, "IP", "IPV6", "IPV4V6", or "PPP".
1712     ApnAuthType authType;
1713     string user;                         // The username for APN, or empty string
1714     string password;                     // The password for APN, or empty string
1715     DataProfileInfoType type;
1716     int32_t maxConnsTime;                // The period in seconds to limit the maximum connections
1717     int32_t maxConns;                    // The maximum connections during maxConnsTime
1718     int32_t waitTime;                    // The required wait time in seconds after a successful UE
1719                                          // initiated disconnect of a given PDN connection before
1720                                          // the device can send a new PDN connection request for
1721                                          // that given PDN
1722     bool enabled;                        // True to enable the profile, false to disable
1723 };
1724
1725 struct RadioCapability {
1726     int32_t session;                     // Unique session value defined by framework returned in
1727                                          // all "responses/unsol"
1728     RadioCapabilityPhase phase;
1729     RadioAccessFamily raf;
1730     string logicalModemUuid;             // A UUID typically "com.xxxx.lmX where X is the logical
1731                                          // modem. RadioConst:MAX_UUID_LENGTH is the max
1732                                          // length
1733     RadioCapabilityStatus status;
1734 };
1735
1736 struct LceStatusInfo {
1737     LceStatus lceStatus;
1738     uint8_t actualIntervalMs;            // actual LCE reporting interval,
1739                                          // meaningful only if LceStatus = ACTIVE.
1740 };
1741
1742 struct LceDataInfo {
1743     uint32_t lastHopCapacityKbps;          // last-hop cellular capacity: kilobits/second.
1744     uint8_t confidenceLevel;               // capacity estimate confidence: 0-100
1745     bool lceSuspended;                     // LCE report going to be suspended? (e.g., radio
1746                                            // moves to inactive state or network type change)
1747                                            // true = suspended;
1748                                            // false = not suspended.
1749 };
1750
1751 struct ActivityStatsInfo {
1752     uint32_t sleepModeTimeMs;              // total time (in ms) when modem is in a low power or
1753                                            // sleep state
1754     uint32_t idleModeTimeMs;               // total time (in ms) when modem is awake but neither
1755                                            // the transmitter nor receiver are active/awake
1756     uint32_t[RadioConst:NUM_TX_POWER_LEVELS] txmModetimeMs;
1757                                            // Each index represent total time (in ms) during which
1758                                            // the transmitter is active/awake for a particular
1759                                            // power range as shown below.
1760                                            // index 0 = tx_power < 0dBm
1761                                            // index 1 = 0dBm < tx_power < 5dBm
1762                                            // index 2 = 5dBm < tx_power < 15dBm
1763                                            // index 3 = 15dBm < tx_power < 20dBm
1764                                            // index 4 = tx_power > 20dBm
1765     uint32_t rxModeTimeMs;                 // total time (in ms) for which receiver is
1766                                            // active/awake and the transmitter is inactive
1767 };
1768
1769 struct Carrier {
1770     string mcc;
1771     string mnc;
1772     CarrierMatchType matchType;            // Specify match type for the carrier.
1773                                            // If it’s ALL, matchData is empty string;
1774                                            // otherwise, matchData is the value for the match type.
1775     string matchData;
1776 };
1777
1778 struct CarrierRestrictions {
1779     vec<Carrier> allowedCarriers;          // whitelist for allowed carriers
1780     vec<Carrier> excludedCarriers;         // blacklist for explicitly excluded carriers
1781                                            // which match allowed_carriers. Eg. allowedCarriers
1782                                            // match mcc/mnc, excludedCarriers has same mcc/mnc and
1783                                            // gid1 is ABCD. It means except the carrier whose gid1
1784                                            // is ABCD, all carriers with the same mcc/mnc are
1785                                            // allowed.
1786 };
1787
1788 struct SuppSvcNotification {
1789     bool isMT;                             // notification type
1790                                            // false = MO intermediate result code
1791                                            // true = MT unsolicited result code
1792     int32_t code;                          // result code. See 27.007 7.17.
1793     int32_t index;                         // CUG index. See 27.007 7.17.
1794     int32_t type;                          // "type" from 27.007 7.17 (MT only).
1795     string number;                         // "number" from 27.007 7.17
1796                                            // (MT only, may be empty string).
1797 };
1798
1799 struct SimRefreshResult {
1800     SimRefreshType type;
1801     int32_t efId;                          // is the EFID of the updated file if the result is
1802                                            // SIM_FILE_UPDATE or 0 for any other result.
1803     string aid;                            // is AID(application ID) of the card application
1804                                            // See ETSI 102.221 8.1 and 101.220 4
1805                                            // For SIM_FILE_UPDATE result it must be set to AID of
1806                                            // application in which updated EF resides or it must be
1807                                            // empty string if EF is outside of an application.
1808                                            // For SIM_INIT result this field is set to AID of
1809                                            // application that caused REFRESH
1810                                            // For SIM_RESET result it is empty string.
1811 };
1812
1813 /* CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */
1814 struct CdmaSignalInfoRecord {
1815     bool isPresent;                        // true if signal information record is present
1816     int8_t signalType;                     // as defined 3.7.5.5-1
1817     int8_t alertPitch;                     // as defined 3.7.5.5-2
1818     int8_t signal;                         // as defined 3.7.5.5-3, 3.7.5.5-4 or 3.7.5.5-5
1819 };
1820
1821 struct CdmaCallWaiting {
1822     string number;                         // Remote party number
1823     CdmaCallWaitingNumberPresentation numberPresentation;
1824     string name;                           // Remote party name
1825     CdmaSignalInfoRecord signalInfoRecord;
1826     // Number type/Number plan required to support International Call Waiting
1827     CdmaCallWaitingNumberType numbertype;
1828     CdmaCallWaitingNumberPlan numberPlan;
1829 };
1830
1831 /*
1832  * Display Info Rec as defined in C.S0005 section 3.7.5.1
1833  * Extended Display Info Rec as defined in C.S0005 section 3.7.5.16
1834  * Note: the Extended Display info rec contains multiple records of the
1835  * form: display_tag, display_len, and display_len occurrences of the
1836  * char field if the display_tag is not 10000000 or 10000001.
1837  * To save space, the records are stored consecutively in a byte buffer.
1838  * The display_tag, display_len and chari fields are all 1 byte.
1839  */
1840 struct CdmaDisplayInfoRecord {
1841     string alphaBuf;                       // Max length = RadioConst:CDMA_ALPHA_INFO_BUFFER_LENGTH
1842 };
1843
1844 /*
1845  * Called Party Number Info Rec as defined in C.S0005 section 3.7.5.2
1846  * Calling Party Number Info Rec as defined in C.S0005 section 3.7.5.3
1847  * Connected Number Info Rec as defined in C.S0005 section 3.7.5.4
1848  */
1849 struct CdmaNumberInfoRecord {
1850     string number;                         // Max length = RADIP_CDMA_NUMBER_INFO_BUFFER_LENGTH
1851     uint8_t numberType;
1852     uint8_t numberPlan;
1853     uint8_t pi;
1854     uint8_t si;
1855 };
1856
1857 struct  CdmaRedirectingNumberInfoRecord{
1858     CdmaNumberInfoRecord redirectingNumber;
1859     CdmaRedirectingReason redirectingReason; // redirectingReason is set to UNKNOWN if not included
1860 };
1861
1862 /* Line Control Information Record as defined in C.S0005 section 3.7.5.15 */
1863 struct CdmaLineControlInfoRecord {
1864     uint8_t lineCtrlPolarityIncluded;
1865     uint8_t lineCtrlToggle;
1866     uint8_t lineCtrlReverse;
1867     uint8_t lineCtrlPowerDenial;
1868 };
1869
1870 /* T53 CLIR Information Record */
1871 struct CdmaT53ClirInfoRecord {
1872     uint8_t cause;
1873 };
1874
1875 /* T53 Audio Control Information Record */
1876 struct CdmaT53AudioControlInfoRecord {
1877     uint8_t upLink;
1878     uint8_t downLink;
1879 };
1880
1881 struct CdmaInformationRecord {
1882     CdmaInfoRecName name;
1883     // Only one of the below vectors must have size = 1 based on the
1884     // CdmaInfoRecName. All other vectors must have size 0.
1885     vec<CdmaDisplayInfoRecord> display;  // Display and Extended Display Info Rec
1886     vec<CdmaNumberInfoRecord> number;    // Called Party Number, Calling Party Number, Connected
1887                                          // number Info Rec
1888     vec<CdmaSignalInfoRecord> signal;    // Signal Info Rec
1889     vec<CdmaRedirectingNumberInfoRecord> redir; // Redirecting Number Info Rec
1890     vec<CdmaLineControlInfoRecord> lineCtrl;    // Line Control Info Rec
1891     vec<CdmaT53ClirInfoRecord> clir;     // T53 CLIR Info Rec
1892     vec<CdmaT53AudioControlInfoRecord> audioCtrl; // T53 Audio Control Info Rec
1893 };
1894
1895 struct CdmaInformationRecords {
1896     vec<CdmaInformationRecord> infoRec;  // Max length = RadioConst:CDMA_MAX_NUMBER_OF_INFO_RECS
1897 };
1898
1899 struct CfData {
1900     vec<CallForwardInfo> cfInfo;         // This is the response data
1901                                          // for SS request to query call
1902                                          // forward status. see getCallForwardStatus()
1903                                          // Max size = RadioConst:NUM_SERVICE_CLASSES
1904 };
1905
1906 struct SsInfoData {
1907     vec<int32_t> ssInfo;                 // This is the response data for all of the SS GET/SET
1908                                          // Radio requests. E.g. IRadio.getClir() returns
1909                                          // two ints, so first two values of ssInfo[] will be
1910                                          // used for response if serviceType is SS_CLIR and
1911                                          // requestType is SS_INTERROGATION
1912                                          // Max size = RadioConst:SS_INFO_MAX
1913 };
1914
1915 struct StkCcUnsolSsResult {
1916     SsServiceType serviceType;
1917     SsRequestType requestType;
1918     SsTeleserviceType teleserviceType;
1919     SuppServiceClass serviceClass;
1920     RadioError result;
1921     // Only one of the below vectors may contain values and other must be empty
1922     vec<SsInfoData> ssInfo;              // Valid only for all SsserviceType except
1923                                          // SsServiceType:CF_* else empty.
1924     vec<CfData> cfData;                  // Valid for SsServiceType:CF_* else empty
1925 };
1926
1927 struct PcoDataInfo {
1928     int32_t cid;                         // Context ID, uniquely identifies this call
1929     string bearerProto;                  // One of the PDP_type values in TS 27.007 section 10.1.1.
1930                                          // For example, "IP", "IPV6", "IPV4V6"
1931     int32_t pcoId;                       // The protocol ID for this box. Note that only IDs from
1932                                          // FF00H - FFFFH are accepted. If more than one is
1933                                          // included from the network, multiple calls must be made
1934                                          // to send all of them.
1935     vec<uint8_t> contents;               // Carrier-defined content. It is binary, opaque and
1936                                          // loosely defined in LTE Layer 3 spec 24.008
1937 };