1/*
2 * Copyright (C) 2019 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
17package android.hardware.radio@1.5;
18
19import @1.0::ApnAuthType;
20import @1.0::AppStatus;
21import @1.0::DataProfileId;
22import @1.0::DataProfileInfoType;
23import @1.0::GsmSignalStrength;
24import @1.0::LteSignalStrength;
25import @1.0::PersoSubstate;
26import @1.0::RadioError;
27import @1.0::RegState;
28import @1.0::TimeStampType;
29import @1.1::EutranBands;
30import @1.1::GeranBands;
31import @1.1::RadioAccessNetworks;
32import @1.1::ScanStatus;
33import @1.1::ScanType;
34import @1.1::UtranBands;
35import @1.2::CellConnectionStatus;
36import @1.2::CellIdentityCdma;
37import @1.2::CellIdentityGsm;
38import @1.2::CellIdentityWcdma;
39import @1.2::CellIdentityTdscdma;
40import @1.2::CellIdentityLte;
41import @1.2::CellInfoCdma;
42import @1.2::IndicationFilter;
43import @1.2::TdscdmaSignalStrength;
44import @1.2::WcdmaSignalStrength;
45import @1.4::AccessNetwork;
46import @1.4::ApnTypes;
47import @1.4::CardStatus;
48import @1.4::CellIdentityNr;
49import @1.4::DataCallFailCause;
50import @1.4::DataConnActiveStatus;
51import @1.4::LteVopsInfo;
52import @1.4::NrIndicators;
53import @1.4::NrSignalStrength;
54import @1.4::PdpProtocolType;
55import @1.4::RadioAccessFamily;
56import @1.4::RadioTechnology;
57
58import android.hidl.safe_union@1.0::Monostate;
59
60/**
61 * Defining signal strength type.
62 */
63enum SignalMeasurementType : int32_t {
64    /**
65     * Received Signal Strength Indication.
66     * Range: -113 dBm and -51 dBm
67     * Used RAN: GERAN, CDMA2000
68     * Reference: 3GPP TS 27.007 section 8.5.
69     */
70    RSSI = 1,
71    /**
72     * Received Signal Code Power.
73     * Range: -120 dBm to -25 dBm;
74     * Used RAN: UTRAN
75     * Reference: 3GPP TS 25.123, section 9.1.1.1
76     */
77    RSCP = 2,
78    /**
79     * Reference Signal Received Power.
80     * Range: -140 dBm to -44 dBm;
81     * Used RAN: EUTRAN
82     * Reference: 3GPP TS 36.133 9.1.4
83     */
84    RSRP = 3,
85    /**
86     * Reference Signal Received Quality
87     * Range: -34 dB to 3 dB;
88     * Used RAN: EUTRAN
89     * Reference: 3GPP TS 36.133 v12.6.0 section 9.1.7
90     */
91    RSRQ = 4,
92    /**
93     * Reference Signal Signal to Noise Ratio
94     * Range: -20 dB to 30 dB;
95     * Used RAN: EUTRAN
96     * Note: this field is optional; how to support it can be decided by the
97     * corresponding vendor. Though the response code is not enforced,
98     * vendor's implementation must ensure this interface not crashing.
99     */
100    RSSNR = 5,
101    /**
102     * 5G SS reference signal received power.
103     * Range: -140 dBm to -44 dBm.
104     * Used RAN: NGRAN
105     * Reference: 3GPP TS 38.215.
106     */
107    SSRSRP = 6,
108    /**
109     * 5G SS reference signal received quality.
110     * Range: -43 dB to 20 dB.
111     * Used RAN: NGRAN
112     * Reference: 3GPP TS 38.215, 3GPP TS 38.133 section 10
113     */
114    SSRSRQ = 7,
115    /**
116     * 5G SS signal-to-noise and interference ratio.
117     * Range: -23 dB to 40 dB
118     * Used RAN: NGRAN
119     * Reference: 3GPP TS 38.215 section 5.1.*, 3GPP TS 38.133 section 10.1.16.1.
120     */
121    SSSINR = 8,
122};
123
124/**
125 * Contains the threshold values of each signal measurement type.
126 */
127struct SignalThresholdInfo {
128    /** Signal Measurement Type */
129    SignalMeasurementType signalMeasurement;
130
131    /** A hysteresis time in milliseconds to prevent flapping. A value of 0 disables hysteresis. */
132    int32_t hysteresisMs;
133
134    /**
135     * An interval in dB defining the required magnitude change between reports.
136     * hysteresisDb must be smaller than the smallest threshold delta.
137     * An interval value of 0 disables hysteresis.
138     */
139    int32_t hysteresisDb;
140
141    /**
142     * List of threshold values.
143     * Range and unit must reference specific @1.5::SignalMeasurementType.
144     * The threshold values for which to apply criteria.
145     * A vector size of 0 disables the use of thresholds for reporting.
146     */
147    vec<int32_t> thresholds;
148
149    /**
150     * Indicates whether the reporting criteria of the corresponding measurement is enabled
151     * (isEnabled==true) or disabled (isEnabled==false).
152     *
153     * If enabled, modem must trigger the report based on the criteria.
154     * If disabled, modem must not trigger the report based on the criteria.
155     */
156    bool isEnabled;
157};
158
159enum AccessNetwork : @1.4::AccessNetwork {
160    /**
161     * Next-Generation Radio Access Network (NGRAN).
162     * Note NGRAN is only for standalone mode. Non-standalone mode uses AccessNetwork EUTRAN.
163     */
164    NGRAN = 6,
165};
166
167enum RadioAccessNetworks : @1.1::RadioAccessNetworks {
168    UNKNOWN = 0,
169    /** Next Generation Radio Access Network */
170    NGRAN = 4,
171    /** CDMA 2000 Network */
172    CDMA2000 = 5,
173};
174
175/**
176 * Overwritten from @1.1::RadioAccessSpecifier to add NGRAN and NgranBands.
177 */
178struct RadioAccessSpecifier {
179    /**
180     * The type of network to scan.
181     */
182    RadioAccessNetworks radioAccessNetwork;
183
184    /**
185     * The frequency bands to scan.
186     * Maximum length of the vector is 8.
187     */
188    safe_union Bands {
189        /** Valid only if radioAccessNetwork = GERAN. */
190        vec<GeranBands> geranBands;
191        /** Valid only if radioAccessNetwork = UTRAN. */
192        vec<UtranBands> utranBands;
193        /** Valid only if radioAccessNetwork = EUTRAN. */
194        vec<EutranBands> eutranBands;
195        /** Valid only if radioAccessNetwork = NGRAN. */
196        vec<NgranBands> ngranBands;
197    } bands;
198
199    /**
200     * The radio channels to scan as defined in 3GPP TS 25.101 and 36.101.
201     * Maximum length of the vector is 32.
202     */
203    vec<int32_t> channels;
204};
205
206/**
207 * IRadio 1.5 supports NGRAN bands up to V16.2.0
208 */
209enum NgranBands : int32_t {
210    /** 3GPP TS 38.101-1, Table 5.2-1: FR1 bands */
211    BAND_1 = 1,
212    BAND_2 = 2,
213    BAND_3 = 3,
214    BAND_5 = 5,
215    BAND_7 = 7,
216    BAND_8 = 8,
217    BAND_12 = 12,
218    BAND_14 = 14,
219    BAND_18 = 18,
220    BAND_20 = 20,
221    BAND_25 = 25,
222    BAND_28 = 28,
223    BAND_29 = 29,
224    BAND_30 = 30,
225    BAND_34 = 34,
226    BAND_38 = 38,
227    BAND_39 = 39,
228    BAND_40 = 40,
229    BAND_41 = 41,
230    BAND_48 = 48,
231    BAND_50 = 50,
232    BAND_51 = 51,
233    BAND_65 = 65,
234    BAND_66 = 66,
235    BAND_70 = 70,
236    BAND_71 = 71,
237    BAND_74 = 74,
238    BAND_75 = 75,
239    BAND_76 = 76,
240    BAND_77 = 77,
241    BAND_78 = 78,
242    BAND_79 = 79,
243    BAND_80 = 80,
244    BAND_81 = 81,
245    BAND_82 = 82,
246    BAND_83 = 83,
247    BAND_84 = 84,
248    BAND_86 = 86,
249    BAND_89 = 89,
250    BAND_90 = 90,
251    BAND_91 = 91,
252    BAND_92 = 92,
253    BAND_93 = 93,
254    BAND_94 = 94,
255    BAND_95 = 95,
256    /** 3GPP TS 38.101-2, Table 5.2-1: FR2 bands */
257    BAND_257 = 257,
258    BAND_258 = 258,
259    BAND_260 = 260,
260    BAND_261 = 261,
261};
262
263/**
264 * Extended from @1.1 UtranBands to add TD-SCDMA bands
265 * IRadio 1.5 supports UTRAN bands up to V15.0.0
266 */
267enum UtranBands : @1.1::UtranBands {
268    /** TD-SCDMA bands. 3GPP TS 25.102, Table 5.2: Frequency bands */
269    BAND_A = 101,
270    BAND_B = 102,
271    BAND_C = 103,
272    BAND_D = 104,
273    BAND_E = 105,
274    BAND_F = 106,
275};
276
277/**
278 * Extended from @1.1 EutranBands to add more bands from 3GPP TS 36.101, Table 5.5: Operating bands
279 * IRadio 1.5 supports EUTRAN bands up to V16.4.0
280 */
281enum EutranBands : @1.1::EutranBands {
282    BAND_49 = 49,
283    BAND_50 = 50,
284    BAND_51 = 51,
285    BAND_52 = 52,
286    BAND_53 = 53,
287    BAND_71 = 71,
288    BAND_72 = 72,
289    BAND_73 = 73,
290    BAND_74 = 74,
291    BAND_85 = 85,
292    BAND_87 = 87,
293    BAND_88 = 88,
294};
295
296/**
297 * Overwritten from @1.2::NetworkScanRequest to update RadioAccessSpecifier to 1.5 version.
298 */
299struct NetworkScanRequest {
300    ScanType type;
301
302    /**
303     * Time interval in seconds between the completion of one scan and the start of
304     * a subsequent scan.
305     * Implementations may ignore this field unless the 'type' is 'PERIODIC'.
306     * Range: ScanIntervalRange:MIN to ScanIntervalRange:MAX
307     */
308    int32_t interval;
309
310    /**
311     * Networks with bands/channels to scan
312     * Maximum length of the vector is RadioConst:RADIO_ACCESS_SPECIFIER_MAX_SIZE
313     */
314    vec<RadioAccessSpecifier> specifiers;
315
316    /**
317     * Maximum duration of the periodic search (in seconds).
318     * If the search lasts maxSearchTime, it must be terminated.
319     * Range: MaxSearchTimeRange:MIN to MaxSearchTimeRange:MAX
320     */
321    int32_t maxSearchTime;
322
323    /**
324     * Indicates whether the modem must report incremental results of the network scan
325     * to the client.
326     * FALSE – Incremental results must not be reported.
327     * TRUE  – Incremental must be reported.
328     */
329    bool incrementalResults;
330
331    /**
332     * Indicates the periodicity with which the modem must report incremental results to
333     * the client (in seconds).
334     * Implementations may ignore this value if the incremental results are not requested.
335     * This value must be less than or equal to maxSearchTime.
336     * Range: IncrementalResultsPeriodicityRange:MIN to IncrementalResultsPeriodicityRange:MAX
337     */
338    int32_t incrementalResultsPeriodicity;
339
340    /**
341     * Describes the List of PLMN ids (MCC-MNC)
342     * If any PLMN of this list is found, search must end at that point and results with all
343     * PLMN found until that point should be sent as response.
344     * If the list is not sent, search to be completed until end and all PLMNs found to be
345     * reported.
346     */
347    vec<string> mccMncs;
348};
349
350enum ApnTypes : @1.4::ApnTypes {
351    /**
352     * APN type for XCAP
353     * NOTE: Due to the addition of this new value, the value ALL defined in
354     * 1.0::ApnTypes is deprecated and should not be used.
355     */
356    XCAP = 1 << 11,
357};
358
359/**
360 * Overwritten from @1.4::DataProfileInfo to update ApnTypes to 1.5 version and replace mtu with
361 * mtuV4 and mtuV6. In the future, this must be extended instead of overwritten.
362 */
363struct DataProfileInfo {
364    /** ID of the data profile. */
365    DataProfileId profileId;
366
367    /** The APN name. */
368    string apn;
369
370    /** PDP_type values. */
371    PdpProtocolType protocol;
372
373    /** PDP_type values used on roaming network. */
374    PdpProtocolType roamingProtocol;
375
376    /** APN authentication type. */
377    ApnAuthType authType;
378
379    /** The username for APN, or empty string. */
380    string user;
381
382    /** The password for APN, or empty string. */
383    string password;
384
385    /** Data profile technology type. */
386    DataProfileInfoType type;
387
388    /** The period in seconds to limit the maximum connections. */
389    int32_t maxConnsTime;
390
391    /** The maximum connections during maxConnsTime. */
392    int32_t maxConns;
393
394    /**
395     * The required wait time in seconds after a successful UE initiated disconnect of a given PDN
396     * connection before the device can send a new PDN connection request for that given PDN.
397     */
398    int32_t waitTime;
399
400    /** True to enable the profile, false to disable. */
401    bool enabled;
402
403    /** Supported APN types bitmap. See ApnTypes for the value of each bit. */
404    bitfield<ApnTypes> supportedApnTypesBitmap;
405
406    /** The bearer bitmap. See RadioAccessFamily for the value of each bit. */
407    bitfield<RadioAccessFamily> bearerBitmap;
408
409    /** Maximum transmission unit (MTU) size in bytes for IPv4. */
410    int32_t mtuV4;
411
412    /** Maximum transmission unit (MTU) size in bytes for IPv6. */
413    int32_t mtuV6;
414
415    /**
416     * True if this data profile was used to bring up the last default (i.e internet) data
417     * connection successfully.
418     */
419    bool preferred;
420
421    /**
422     * If true, modem must persist this data profile and profileId must not be
423     * set to DataProfileId.INVALID. If the same data profile exists, this data profile must
424     * overwrite it.
425     */
426    bool persistent;
427};
428
429/**
430 * The properties of the link address. This enum reflects the definition in
431 * if_addr.h in Linux kernel.
432 */
433enum AddressProperty : int32_t {
434    NONE = 0,
435
436    /** Indicates this address is deprecated */
437    DEPRECATED = 0x20,
438};
439
440/**
441 * Describes a data link address for mobile data connection.
442 */
443struct LinkAddress {
444    /**
445     * The format is IP address with optional "/"
446     * prefix length (The format is defined in RFC-4291 section 2.3). For example, "192.0.1.3",
447     * "192.0.1.11/16", or "2001:db8::1/64". Typically one IPv4 or one IPv6 or one of each. If
448     * the prefix length is absent, then the addresses are assumed to be point to point with
449     * IPv4 with prefix length 32 or IPv6 with prefix length 128.
450     */
451    string address;
452
453    /**
454     * The properties of the link address
455     */
456    bitfield<AddressProperty> properties;
457
458    /**
459     * The time, as reported by SystemClock.elapsedRealtime(), when this link address will be or
460     * was deprecated. -1 indicates this information is not available. At the time existing
461     * connections can still use this address until it expires, but new connections should use the
462     * new address. LONG_MAX(0x7FFFFFFFFFFFFFFF) indicates this link address will never be
463     * deprecated.
464     */
465    uint64_t deprecationTime;
466
467    /**
468     * The time, as reported by SystemClock.elapsedRealtime(), when this link address will expire
469     * and be removed from the interface. -1 indicates this information is not available.
470     * LONG_MAX(0x7FFFFFFFFFFFFFFF) indicates this link address will never expire.
471     */
472    uint64_t expirationTime;
473};
474
475/**
476 * Overwritten from @1.4::SetupDataCallResult in order to update the addresses to 1.5 version.
477 * In 1.5 the type of addresses changes to vector of LinkAddress, and mtu is replaced by
478 * mtuV4 and mtuV6.
479 */
480struct SetupDataCallResult {
481    /** Data call fail cause. DataCallFailCause.NONE if no error. */
482    DataCallFailCause cause;
483
484    /**
485     * If status != DataCallFailCause.NONE, this field indicates the suggested retry back-off timer
486     * value RIL wants to override the one pre-configured in FW. The unit is milliseconds.
487     * The value < 0 means no value is suggested.
488     * The value 0 means retry must be done ASAP.
489     * The value of INT_MAX(0x7fffffff) means no retry.
490     */
491    int32_t suggestedRetryTime;
492
493    /** Context ID, uniquely identifies this call. */
494    int32_t cid;
495
496    /** Data connection active status. */
497    DataConnActiveStatus active;
498
499    /**
500     * PDP_type values. If cause is DataCallFailCause.ONLY_SINGLE_BEARER_ALLOWED, this is the type
501     * supported such as "IP" or "IPV6".
502     */
503    PdpProtocolType type;
504
505    /** The network interface name. */
506    string ifname;
507
508    /**
509     * List of link address.
510     */
511    vec<LinkAddress> addresses;
512
513    /**
514     * List of DNS server addresses, e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1". Empty if no dns
515     * server addresses returned.
516     */
517    vec<string> dnses;
518
519    /**
520     * List of default gateway addresses, e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
521     * When empty, the addresses represent point to point connections.
522     */
523    vec<string> gateways;
524
525    /**
526     * List of P-CSCF(Proxy Call State Control Function) addresses via PCO(Protocol Configuration
527     * Option), e.g., "2001:db8::1 2001:db8::2 2001:db8::3". Empty if not IMS client.
528     */
529    vec<string> pcscf;
530
531    /**
532     * MTU received from network for IPv4.
533     * Value <= 0 means network has either not sent a value or sent an invalid value.
534     */
535    int32_t mtuV4;
536
537    /**
538     * MTU received from network for IPv6.
539     * Value <= 0 means network has either not sent a value or sent an invalid value.
540     */
541    int32_t mtuV6;
542};
543
544enum Domain : int32_t {
545    /** Circuit-switched */
546    CS = 1 << 0,
547
548    /** Packet-switched */
549    PS = 1 << 1,
550};
551
552struct ClosedSubscriberGroupInfo {
553    /**
554     * Indicates whether the cell is restricted to only CSG members. A cell not broadcasting the
555     * CSG Indication but reporting CSG information is considered a Hybrid Cell.
556     * Refer to the "csg-Indication" field in 3GPP TS 36.331 section 6.2.2
557     * SystemInformationBlockType1.
558     * Also refer to "CSG Indicator" in 3GPP TS 25.331 section 10.2.48.8.1 and TS 25.304.
559     */
560    bool csgIndication;
561
562    /**
563     * The human-readable name of the closed subscriber group operating this cell.
564     * Refer to "hnb-Name" in TS 36.331 section 6.2.2 SystemInformationBlockType9.
565     * Also refer to "HNB Name" in 3GPP TS25.331 section 10.2.48.8.23 and TS 23.003 section 4.8.
566     */
567    string homeNodebName;
568
569    /**
570     * The identity of the closed subscriber group that the cell belongs to.
571     * Refer to "CSG-Identity" in TS 36.336 section 6.3.4.
572     * Also refer to "CSG Identity" in 3GPP TS 25.331 section 10.3.2.8 and TS 23.003 section 4.7.
573     */
574    int32_t csgIdentity;
575};
576
577safe_union OptionalCsgInfo {
578    /**
579     * If no CSG info is provided by the cell, then this structure shall be present.
580     */
581    Monostate noinit;
582
583    /**
584     * If CSG info is provided by the cell, this structure shall be present.
585     */
586    ClosedSubscriberGroupInfo csgInfo;
587};
588
589struct CellIdentityGsm {
590    /**
591     * The fields "mcc" and "mnc" must contain the PLMN-ID of the primary PLMN of this cell.
592     */
593    @1.2::CellIdentityGsm base;
594
595    /** Additional PLMN-IDs beyond the primary PLMN broadcast for this cell */
596    vec<string> additionalPlmns;
597};
598
599struct CellIdentityWcdma {
600    /**
601     * The fields "mcc" and "mnc" must contain the PLMN-ID of the primary PLMN of this cell.
602     */
603    @1.2::CellIdentityWcdma base;
604
605    /** Additional PLMN-IDs beyond the primary PLMN broadcast for this cell */
606    vec<string> additionalPlmns;
607
608    /** Information about any closed subscriber group ID for this cell */
609    OptionalCsgInfo optionalCsgInfo;
610};
611
612struct CellIdentityTdscdma {
613    /**
614     * The fields "mcc" and "mnc" must contain the PLMN-ID of the primary PLMN of this cell.
615     */
616    @1.2::CellIdentityTdscdma base;
617
618    /** Additional PLMN-IDs beyond the primary PLMN broadcast for this cell */
619    vec<string> additionalPlmns;
620
621    /** Information about any closed subscriber group ID for this cell */
622    OptionalCsgInfo optionalCsgInfo;
623};
624
625struct CellIdentityLte {
626    /**
627     * The fields "mcc" and "mnc" must contain the PLMN-ID of the primary PLMN of this cell.
628     */
629    @1.2::CellIdentityLte base;
630
631    /** Additional PLMN-IDs beyond the primary PLMN broadcast for this cell */
632    vec<string> additionalPlmns;
633
634    /** Information about any closed subscriber group ID for this cell */
635    OptionalCsgInfo optionalCsgInfo;
636
637    /** Bands used by the cell. */
638    vec<EutranBands> bands;
639};
640
641/**
642 * The CellIdentity structure should be reported once for each element of the PLMN-IdentityInfoList
643 * broadcast in SIB1 CellAccessRelatedInfo as per 3GPP TS 38.331 Section 6.3.2.
644 */
645struct CellIdentityNr {
646    /**
647     * The fields "mcc" and "mnc" must contain the PLMN-ID of the primary PLMN of this cell.
648     */
649    @1.4::CellIdentityNr base;
650
651    /** Additional PLMN-IDs beyond the primary PLMN broadcast for this cell */
652    vec<string> additionalPlmns;
653
654    /** Bands used by the cell. */
655    vec<NgranBands> bands;
656};
657
658struct CellInfoGsm {
659    CellIdentityGsm cellIdentityGsm;
660    GsmSignalStrength signalStrengthGsm;
661};
662
663struct CellInfoWcdma {
664    CellIdentityWcdma cellIdentityWcdma;
665    WcdmaSignalStrength signalStrengthWcdma;
666};
667
668struct CellInfoTdscdma {
669    CellIdentityTdscdma cellIdentityTdscdma;
670    TdscdmaSignalStrength signalStrengthTdscdma;
671};
672
673struct CellInfoLte {
674    CellIdentityLte cellIdentityLte;
675    LteSignalStrength signalStrengthLte;
676};
677
678struct CellInfoNr {
679    CellIdentityNr cellIdentityNr;
680    NrSignalStrength signalStrengthNr;
681};
682
683struct CellInfo {
684    /**
685     * True if this cell is registered false if not registered.
686     */
687    bool registered;
688    /**
689     * Type of time stamp represented by timeStamp.
690     */
691    TimeStampType timeStampType;
692    /**
693     * Time in nanos as returned by ril_nano_time.
694     */
695    uint64_t timeStamp;
696    /**
697     * Connection status for the cell.
698     */
699    CellConnectionStatus connectionStatus;
700
701    safe_union CellInfoRatSpecificInfo {
702        /**
703         * 3gpp CellInfo types.
704         */
705        CellInfoGsm gsm;
706        CellInfoWcdma wcdma;
707        CellInfoTdscdma tdscdma;
708        CellInfoLte lte;
709        CellInfoNr nr;
710
711        /**
712         * 3gpp2 CellInfo types;
713         */
714        CellInfoCdma cdma;
715    } ratSpecificInfo;
716};
717
718/** A union representing the CellIdentity of a single cell. */
719safe_union CellIdentity {
720    Monostate noinit;
721
722    CellIdentityGsm gsm;
723    CellIdentityWcdma wcdma;
724    CellIdentityTdscdma tdscdma;
725    CellIdentityCdma cdma;
726    CellIdentityLte lte;
727    CellIdentityNr nr;
728};
729
730struct BarringInfo {
731    /**
732     * Combined list of barring services for UTRAN, EUTRAN, and NGRAN.
733     *
734     * Barring information is defined in:
735     * -UTRAN - 3gpp 25.331 Sec 10.2.48.8.6.
736     * -EUTRAN - 3gpp 36.331 Sec 6.3.1 SystemInformationBlockType2
737     * -NGRAN - 3gpp 38.331 Sec 6.3.2 UAC-BarringInfo and 22.261 Sec 6.22.2.[2-3]
738     */
739    enum ServiceType : int32_t {
740        /** Applicable to UTRAN */
741        /** Barring for all CS services, including registration */
742        CS_SERVICE,
743        /** Barring for all PS services, including registration */
744        PS_SERVICE,
745        /** Barring for mobile-originated circuit-switched voice calls */
746        CS_VOICE,
747
748        /** Applicable to EUTRAN, NGRAN */
749        /** Barring for mobile-originated signalling for any purpose */
750        MO_SIGNALLING,
751        /** Barring for mobile-originated internet or other interactive data */
752        MO_DATA,
753        /** Barring for circuit-switched fallback calling */
754        CS_FALLBACK,
755        /** Barring for IMS voice calling */
756        MMTEL_VOICE,
757        /** Barring for IMS video calling */
758        MMTEL_VIDEO,
759
760        /** Applicable to UTRAN, EUTRAN, NGRAN */
761        /** Barring for emergency services, either CS or emergency MMTEL */
762        EMERGENCY,
763        /** Barring for short message services */
764        SMS,
765
766        /** Operator-specific barring codes; applicable to NGRAN */
767        OPERATOR_1 = 1001,
768        OPERATOR_2 = 1002,
769        OPERATOR_3 = 1003,
770        OPERATOR_4 = 1004,
771        OPERATOR_5 = 1005,
772        OPERATOR_6 = 1006,
773        OPERATOR_7 = 1007,
774        OPERATOR_8 = 1008,
775        OPERATOR_9 = 1009,
776        OPERATOR_10 = 1010,
777        OPERATOR_11 = 1011,
778        OPERATOR_12 = 1012,
779        OPERATOR_13 = 1013,
780        OPERATOR_14 = 1014,
781        OPERATOR_15 = 1015,
782        OPERATOR_16 = 1016,
783        OPERATOR_17 = 1017,
784        OPERATOR_18 = 1018,
785        OPERATOR_19 = 1019,
786        OPERATOR_20 = 1020,
787        OPERATOR_21 = 1021,
788        OPERATOR_22 = 1022,
789        OPERATOR_23 = 1023,
790        OPERATOR_24 = 1024,
791        OPERATOR_25 = 1025,
792        OPERATOR_26 = 1026,
793        OPERATOR_27 = 1027,
794        OPERATOR_28 = 1028,
795        OPERATOR_29 = 1029,
796        OPERATOR_30 = 1030,
797        OPERATOR_31 = 1031,
798        OPERATOR_32 = 1032,
799    } serviceType;
800
801    /** The type of barring applied to the service */
802    enum BarringType : int32_t {
803        /** Device is not barred for the given service */
804        NONE,
805        /** Device may be barred based on time and probability factors */
806        CONDITIONAL,
807        /* Device is unconditionally barred */
808        UNCONDITIONAL,
809    } barringType;
810
811    /** Type-specific barring info if applicable */
812    safe_union BarringTypeSpecificInfo {
813        /** Barring type is either none or unconditional */
814        Monostate noinit;
815
816        /** Must be included if barring is conditional */
817        struct Conditional {
818            /** The barring factor as a percentage 0-100 */
819            int32_t factor;
820
821            /** The number of seconds between re-evaluations of barring */
822            int32_t timeSeconds;
823
824            /**
825             * Indicates whether barring is currently being applied.
826             *
827             * <p>True if the UE applies barring to a conditionally barred
828             * service based on the conditional barring parameters.
829             *
830             * <p>False if the service is conditionally barred but barring
831             * is not currently applied, which could be due to either the
832             * barring criteria not having been evaluated (if the UE has not
833             * attempted to use the service) or due to the criteria being
834             * evaluated and the UE being permitted to use the service
835             * despite conditional barring.
836             */
837            bool isBarred;
838        } conditional;
839    } barringTypeSpecificInfo;
840};
841
842enum IndicationFilter : @1.2::IndicationFilter {
843    /** Control the unsolicited sending of registration failure reports via onRegistrationFailed */
844    REGISTRATION_FAILURE = 1 << 5,
845    /** Control the unsolicited sending of barring info updates via onBarringInfo */
846    BARRING_INFO = 1 << 6,
847};
848
849/**
850 * Call fail causes for Circuit-switched service enumerated in 3GPP TS 24.008, 10.5.3.6 and
851 * 10.5.147. Additional detail is available in 3GPP TS 24.008 Annex G.
852 */
853enum RegistrationFailCause : int32_t {
854    /** 0 - None */
855    NONE = 0,
856    /** 2 - IMSI unknown in HLR */
857    IMSI_UNKNOWN_IN_HLR = 2,
858    /** 3 - Illegal MS */
859    ILLEGAL_MS = 3,
860    /** 4 - Illegal ME */
861    IMSI_UNKNOWN_IN_VLR = 4,
862    /** 5 - PLMN not allowed */
863    IMEI_NOT_ACCEPTED = 5,
864    /** 6 - Location area not allowed */
865    ILLEGAL_ME = 6,
866    /** 7 - Roaming not allowed */
867    GPRS_SERVICES_NOT_ALLOWED = 7,
868    /** 8 - No Suitable Cells in this Location Area */
869    GPRS_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 8,
870    /** 9 - Network failure */
871    MS_IDENTITY_CANNOT_BE_DERIVED_BY_NETWORK = 9,
872    /** 10 - Persistent location update reject */
873    IMPLICITLY_DETACHED = 10,
874    /** 11 - PLMN not allowed */
875    PLMN_NOT_ALLOWED = 11,
876    /** 12 - Location area not allowed */
877    LOCATION_AREA_NOT_ALLOWED = 12,
878    /** 13 - Roaming not allowed in this Location Area */
879    ROAMING_NOT_ALLOWED = 13,
880    /** 14 - GPRS Services not allowed in this PLMN */
881    GPRS_SERVICES_NOT_ALLOWED_IN_PLMN = 14,
882    /** 15 - No Suitable Cells in this Location Area */
883    NO_SUITABLE_CELLS = 15,
884    /** 16 - MSC temporarily not reachable */
885    MSC_TEMPORARILY_NOT_REACHABLE = 15,
886    /** 17 - Network Failure */
887    NETWORK_FAILURE = 17,
888    /** 20 - MAC Failure */
889    MAC_FAILURE = 20,
890    /** 21 - Sync Failure */
891    SYNC_FAILURE = 21,
892    /** 22 - Congestion */
893    CONGESTION = 22,
894    /** 23 - GSM Authentication unacceptable */
895    GSM_AUTHENTICATION_UNACCEPTABLE = 23,
896    /** 25 - Not Authorized for this CSG */
897    NOT_AUTHORIZED_FOR_THIS_CSG = 25,
898    /** 28 SMS provided via GPRS in this routing area */
899    SMS_PROVIDED_BY_GPRS_IN_ROUTING_AREA,
900    /** 32 - Service option not supported */
901    SERVICE_OPTION_NOT_SUPPORTED = 32,
902    /** 33 - Requested service option not subscribed */
903    SERVICE_OPTION_NOT_SUBSCRIBED = 33,
904    /** 34 - Service option temporarily out of order */
905    SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER = 34,
906    /** 38 - Call cannot be identified */
907    CALL_CANNOT_BE_IDENTIFIED = 38,
908    /** 40 No PDP context activated */
909    NO_PDP_CONTEXT_ACTIVATED = 40,
910    /** 48-63 - Retry upon entry into a new cell */
911    RETRY_UPON_ENTRY_INTO_NEW_CELL_1 = 48,
912    RETRY_UPON_ENTRY_INTO_NEW_CELL_2 = 49,
913    RETRY_UPON_ENTRY_INTO_NEW_CELL_3 = 50,
914    RETRY_UPON_ENTRY_INTO_NEW_CELL_4 = 51,
915    RETRY_UPON_ENTRY_INTO_NEW_CELL_5 = 52,
916    RETRY_UPON_ENTRY_INTO_NEW_CELL_6 = 53,
917    RETRY_UPON_ENTRY_INTO_NEW_CELL_7 = 54,
918    RETRY_UPON_ENTRY_INTO_NEW_CELL_8 = 55,
919    RETRY_UPON_ENTRY_INTO_NEW_CELL_9 = 56,
920    RETRY_UPON_ENTRY_INTO_NEW_CELL_10 = 57,
921    RETRY_UPON_ENTRY_INTO_NEW_CELL_11 = 58,
922    RETRY_UPON_ENTRY_INTO_NEW_CELL_12 = 59,
923    RETRY_UPON_ENTRY_INTO_NEW_CELL_13 = 60,
924    RETRY_UPON_ENTRY_INTO_NEW_CELL_14 = 61,
925    RETRY_UPON_ENTRY_INTO_NEW_CELL_15 = 62,
926    RETRY_UPON_ENTRY_INTO_NEW_CELL_16 = 63,
927    /** 95 - Semantically incorrect message */
928    SEMANTICALLY_INCORRECT_MESSAGE = 95,
929    /** 96 - Invalid mandatory information */
930    INVALID_MANDATORY_INFORMATION = 96,
931    /** 97 - Message type non-existent or not implemented */
932    MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED = 97,
933    /** 98 - Message type not compatible with protocol state */
934    MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98,
935    /** 99 - Information element non-existent or not implemented */
936    INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED = 99,
937    /** 100 - Conditional IE error */
938    CONDITIONAL_IE_ERROR = 100,
939    /** 101 - Message not compatible with protocol state */
940    MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101,
941    /** 111 - Protocol error, unspecified */
942    PROTOCOL_ERROR_UNSPECIFIED = 111,
943};
944
945enum PrlIndicator : int32_t {
946    NOT_REGISTERED = -1,
947    NOT_IN_PRL = 0,
948    IN_PRL = 1,
949};
950
951struct RegStateResult {
952    /**
953     * Registration state
954     *
955     * If the RAT is indicated as a GERAN, UTRAN, or CDMA2000 technology, this value reports
956     * registration in the Circuit-switched domain.
957     * If the RAT is indicated as an EUTRAN, NGRAN, or another technology that does not support
958     * circuit-switched services, this value reports registration in the Packet-switched domain.
959     */
960    RegState regState;
961
962    /**
963     * Indicates the available voice radio technology, valid values as
964     * defined by RadioTechnology.
965     */
966    RadioTechnology rat;
967
968    /**
969     * Cause code reported by the network in case registration fails. This will be a mobility
970     * management cause code defined for MM, GMM, MME or equivalent as appropriate for the RAT.
971     */
972    RegistrationFailCause reasonForDenial;
973
974    /** CellIdentity */
975    CellIdentity cellIdentity;
976
977    /**
978     * The most-recent PLMN-ID upon which the UE registered (or attempted to register if a failure
979     * is reported in the reasonForDenial field). This PLMN shall be in standard format consisting
980     * of a 3 digit MCC concatenated with a 2 or 3 digit MNC.
981     */
982    string registeredPlmn;
983
984    /**
985     * Access-technology-specific registration information, such as for CDMA2000.
986     */
987    safe_union AccessTechnologySpecificInfo {
988        Monostate noinit;
989
990        struct Cdma2000RegistrationInfo {
991            /**
992             * Concurrent services support indicator. if registered on a CDMA system.
993             * false - Concurrent services not supported,
994             * true - Concurrent services supported
995             */
996            bool cssSupported;
997
998            /**
999             * TSB-58 Roaming Indicator if registered on a CDMA or EVDO system or -1 if not.
1000             * Valid values are 0-255.
1001             */
1002            int32_t roamingIndicator;
1003
1004            /**
1005             * Indicates whether the current system is in the PRL if registered on a CDMA or EVDO
1006             * system or -1 if not. 0=not in the PRL, 1=in the PRL.
1007             */
1008            PrlIndicator systemIsInPrl;
1009
1010            /**
1011             * Default Roaming Indicator from the PRL if registered on a CDMA or EVDO system or -1
1012             * if not.
1013             * Valid values are 0-255.
1014             */
1015            int32_t defaultRoamingIndicator;
1016        } cdmaInfo;
1017
1018        struct EutranRegistrationInfo {
1019            /**
1020             * Network capabilities for voice over PS services. This info is valid only on LTE
1021             * network and must be present when device is camped on LTE. VopsInfo must be empty when
1022             * device is camped only on 2G/3G.
1023             */
1024            LteVopsInfo lteVopsInfo;
1025
1026            /**
1027             * The parameters of NR 5G Non-Standalone. This value is only valid on E-UTRAN,
1028             * otherwise must be empty.
1029             */
1030            NrIndicators nrIndicators;
1031        } eutranInfo;
1032    } accessTechnologySpecificInfo;
1033};
1034
1035/** Overwritten from @1.4::NetworkScanResult in order to update the CellInfo to 1.5 version. */
1036struct NetworkScanResult {
1037    /**
1038     * The status of the scan.
1039     */
1040    ScanStatus status;
1041
1042    /**
1043     * The error code of the incremental result.
1044     */
1045    RadioError error;
1046
1047    /**
1048     * List of network information as CellInfo.
1049     */
1050    vec<CellInfo> networkInfos;
1051};
1052
1053/**
1054 * Additional personalization categories in addition to those specified in 3GPP TS 22.022 and
1055 * 3GPP2 C.S0068-0.
1056 */
1057enum PersoSubstate : @1.0::PersoSubstate {
1058    /**
1059     * The device is personalized using the content of the Service Provider Name (SPN) in the SIM
1060     * card.
1061     */
1062    SIM_SPN,
1063    SIM_SPN_PUK,
1064    /**
1065     * Service Provider and Equivalent Home PLMN
1066     * The device is personalized using both the content of the GID1 (equivalent to service provider
1067     * personalization) and the content of the Equivalent Home PLMN (EHPLMN) in the SIM card.
1068     * If the GID1 in the SIM is absent, then just the content of the Equivalent Home PLMN
1069     * is matched.
1070     */
1071    SIM_SP_EHPLMN,
1072    SIM_SP_EHPLMN_PUK,
1073    /**
1074     * Device is personalized using the first digits of the ICCID of the SIM card.
1075     */
1076    SIM_ICCID,
1077    SIM_ICCID_PUK,
1078    /**
1079     * Device is personalized using the content of the IMPI in the ISIM.
1080     */
1081    SIM_IMPI,
1082    SIM_IMPI_PUK,
1083    /**
1084     * Network Subset and Service Provider
1085     * Device is personalized using both the content of GID1 (equivalent to service provider
1086     * personalization) and the first digits of the IMSI (equivalent to network subset
1087     * personalization).
1088     */
1089    SIM_NS_SP,
1090    SIM_NS_SP_PUK,
1091};
1092
1093/** Extended from @1.0::AppStatus to update PersoSubstate to 1.5 version. */
1094struct AppStatus {
1095    @1.0::AppStatus base;
1096
1097    /** Applicable only if appState == SUBSCRIPTION_PERSO */
1098    PersoSubstate persoSubstate;
1099};
1100
1101
1102/** Extended from @1.4::CardStatus to use 1.5 version of AppStatus. */
1103struct CardStatus {
1104    @1.4::CardStatus base;
1105
1106    /** size <= RadioConst::CARD_MAX_APPS */
1107    vec<AppStatus> applications;
1108};
1109