summaryrefslogtreecommitdiff
path: root/radio/1.5/types.hal
blob: c1f3f0358eb5c979f32260da2f65724419b20123 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.hardware.radio@1.5;

import @1.0::ApnAuthType;
import @1.0::AppStatus;
import @1.0::DataProfileId;
import @1.0::DataProfileInfoType;
import @1.0::GsmSignalStrength;
import @1.0::LteSignalStrength;
import @1.0::PersoSubstate;
import @1.0::RadioError;
import @1.0::RegState;
import @1.0::TimeStampType;
import @1.1::EutranBands;
import @1.1::GeranBands;
import @1.1::RadioAccessNetworks;
import @1.1::ScanStatus;
import @1.1::ScanType;
import @1.1::UtranBands;
import @1.2::CellConnectionStatus;
import @1.2::CellIdentityCdma;
import @1.2::CellIdentityGsm;
import @1.2::CellIdentityWcdma;
import @1.2::CellIdentityTdscdma;
import @1.2::CellIdentityLte;
import @1.2::CellInfoCdma;
import @1.2::IndicationFilter;
import @1.2::TdscdmaSignalStrength;
import @1.2::WcdmaSignalStrength;
import @1.4::AccessNetwork;
import @1.4::ApnTypes;
import @1.4::CardStatus;
import @1.4::CellIdentityNr;
import @1.4::DataCallFailCause;
import @1.4::DataConnActiveStatus;
import @1.4::LteVopsInfo;
import @1.4::NrIndicators;
import @1.4::NrSignalStrength;
import @1.4::PdpProtocolType;
import @1.4::RadioAccessFamily;
import @1.4::RadioTechnology;

import android.hidl.safe_union@1.0::Monostate;

/**
 * Defining signal strength type.
 */
enum SignalMeasurementType : int32_t {
    /**
     * Received Signal Strength Indication.
     * Range: -113 dBm and -51 dBm
     * Used RAN: GERAN, CDMA2000
     * Reference: 3GPP TS 27.007 section 8.5.
     */
    RSSI = 1,
    /**
     * Received Signal Code Power.
     * Range: -120 dBm to -25 dBm;
     * Used RAN: UTRAN
     * Reference: 3GPP TS 25.123, section 9.1.1.1
     */
    RSCP = 2,
    /**
     * Reference Signal Received Power.
     * Range: -140 dBm to -44 dBm;
     * Used RAN: EUTRAN
     * Reference: 3GPP TS 36.133 9.1.4
     */
    RSRP = 3,
    /**
     * Reference Signal Received Quality
     * Range: -34 dB to 3 dB;
     * Used RAN: EUTRAN
     * Reference: 3GPP TS 36.133 v12.6.0 section 9.1.7
     */
    RSRQ = 4,
    /**
     * Reference Signal Signal to Noise Ratio
     * Range: -20 dB to 30 dB;
     * Used RAN: EUTRAN
     * Note: this field is optional; how to support it can be decided by the
     * corresponding vendor. Though the response code is not enforced,
     * vendor's implementation must ensure this interface not crashing.
     */
    RSSNR = 5,
    /**
     * 5G SS reference signal received power.
     * Range: -140 dBm to -44 dBm.
     * Used RAN: NGRAN
     * Reference: 3GPP TS 38.215.
     */
    SSRSRP = 6,
    /**
     * 5G SS reference signal received quality.
     * Range: -43 dB to 20 dB.
     * Used RAN: NGRAN
     * Reference: 3GPP TS 38.215, 3GPP TS 38.133 section 10
     */
    SSRSRQ = 7,
    /**
     * 5G SS signal-to-noise and interference ratio.
     * Range: -23 dB to 40 dB
     * Used RAN: NGRAN
     * Reference: 3GPP TS 38.215 section 5.1.*, 3GPP TS 38.133 section 10.1.16.1.
     */
    SSSINR = 8,
};

/**
 * Contains the threshold values of each signal measurement type.
 */
struct SignalThresholdInfo {
    /** Signal Measurement Type */
    SignalMeasurementType signalMeasurement;

    /** A hysteresis time in milliseconds to prevent flapping. A value of 0 disables hysteresis. */
    int32_t hysteresisMs;

    /**
     * An interval in dB defining the required magnitude change between reports.
     * hysteresisDb must be smaller than the smallest threshold delta.
     * An interval value of 0 disables hysteresis.
     */
    int32_t hysteresisDb;

    /**
     * List of threshold values.
     * Range and unit must reference specific @1.5::SignalMeasurementType.
     * The threshold values for which to apply criteria.
     * A vector size of 0 disables the use of thresholds for reporting.
     */
    vec<int32_t> thresholds;

    /**
     * Indicates whether the reporting criteria of the corresponding measurement is enabled
     * (isEnabled==true) or disabled (isEnabled==false).
     *
     * If enabled, modem must trigger the report based on the criteria.
     * If disabled, modem must not trigger the report based on the criteria.
     */
    bool isEnabled;
};

enum AccessNetwork : @1.4::AccessNetwork {
    /**
     * Next-Generation Radio Access Network (NGRAN).
     * Note NGRAN is only for standalone mode. Non-standalone mode uses AccessNetwork EUTRAN.
     */
    NGRAN = 6,
};

enum RadioAccessNetworks : @1.1::RadioAccessNetworks {
    UNKNOWN = 0,
    /** Next Generation Radio Access Network */
    NGRAN = 4,
    /** CDMA 2000 Network */
    CDMA2000 = 5,
};

/**
 * Overwritten from @1.1::RadioAccessSpecifier to add NGRAN and NgranBands.
 */
struct RadioAccessSpecifier {
    /**
     * The type of network to scan.
     */
    RadioAccessNetworks radioAccessNetwork;

    /**
     * The frequency bands to scan.
     * Maximum length of the vector is 8.
     */
    safe_union Bands {
        /** Valid only if radioAccessNetwork = GERAN. */
        vec<GeranBands> geranBands;
        /** Valid only if radioAccessNetwork = UTRAN. */
        vec<UtranBands> utranBands;
        /** Valid only if radioAccessNetwork = EUTRAN. */
        vec<EutranBands> eutranBands;
        /** Valid only if radioAccessNetwork = NGRAN. */
        vec<NgranBands> ngranBands;
    } bands;

    /**
     * The radio channels to scan as defined in 3GPP TS 25.101 and 36.101.
     * Maximum length of the vector is 32.
     */
    vec<int32_t> channels;
};

/**
 * IRadio 1.5 supports NGRAN bands up to V16.2.0
 */
enum NgranBands : int32_t {
    /** 3GPP TS 38.101-1, Table 5.2-1: FR1 bands */
    BAND_1 = 1,
    BAND_2 = 2,
    BAND_3 = 3,
    BAND_5 = 5,
    BAND_7 = 7,
    BAND_8 = 8,
    BAND_12 = 12,
    BAND_14 = 14,
    BAND_18 = 18,
    BAND_20 = 20,
    BAND_25 = 25,
    BAND_28 = 28,
    BAND_29 = 29,
    BAND_30 = 30,
    BAND_34 = 34,
    BAND_38 = 38,
    BAND_39 = 39,
    BAND_40 = 40,
    BAND_41 = 41,
    BAND_48 = 48,
    BAND_50 = 50,
    BAND_51 = 51,
    BAND_65 = 65,
    BAND_66 = 66,
    BAND_70 = 70,
    BAND_71 = 71,
    BAND_74 = 74,
    BAND_75 = 75,
    BAND_76 = 76,
    BAND_77 = 77,
    BAND_78 = 78,
    BAND_79 = 79,
    BAND_80 = 80,
    BAND_81 = 81,
    BAND_82 = 82,
    BAND_83 = 83,
    BAND_84 = 84,
    BAND_86 = 86,
    BAND_89 = 89,
    BAND_90 = 90,
    BAND_91 = 91,
    BAND_92 = 92,
    BAND_93 = 93,
    BAND_94 = 94,
    BAND_95 = 95,
    /** 3GPP TS 38.101-2, Table 5.2-1: FR2 bands */
    BAND_257 = 257,
    BAND_258 = 258,
    BAND_260 = 260,
    BAND_261 = 261,
};

/**
 * Extended from @1.1 UtranBands to add TD-SCDMA bands
 * IRadio 1.5 supports UTRAN bands up to V15.0.0
 */
enum UtranBands : @1.1::UtranBands {
    /** TD-SCDMA bands. 3GPP TS 25.102, Table 5.2: Frequency bands */
    BAND_A = 101,
    BAND_B = 102,
    BAND_C = 103,
    BAND_D = 104,
    BAND_E = 105,
    BAND_F = 106,
};

/**
 * Extended from @1.1 EutranBands to add more bands from 3GPP TS 36.101, Table 5.5: Operating bands
 * IRadio 1.5 supports EUTRAN bands up to V16.4.0
 */
enum EutranBands : @1.1::EutranBands {
    BAND_49 = 49,
    BAND_50 = 50,
    BAND_51 = 51,
    BAND_52 = 52,
    BAND_53 = 53,
    BAND_71 = 71,
    BAND_72 = 72,
    BAND_73 = 73,
    BAND_74 = 74,
    BAND_85 = 85,
    BAND_87 = 87,
    BAND_88 = 88,
};

/**
 * Overwritten from @1.2::NetworkScanRequest to update RadioAccessSpecifier to 1.5 version.
 */
struct NetworkScanRequest {
    ScanType type;

    /**
     * Time interval in seconds between the completion of one scan and the start of
     * a subsequent scan.
     * Implementations may ignore this field unless the 'type' is 'PERIODIC'.
     * Range: ScanIntervalRange:MIN to ScanIntervalRange:MAX
     */
    int32_t interval;

    /**
     * Networks with bands/channels to scan
     * Maximum length of the vector is RadioConst:RADIO_ACCESS_SPECIFIER_MAX_SIZE
     */
    vec<RadioAccessSpecifier> specifiers;

    /**
     * Maximum duration of the periodic search (in seconds).
     * If the search lasts maxSearchTime, it must be terminated.
     * Range: MaxSearchTimeRange:MIN to MaxSearchTimeRange:MAX
     */
    int32_t maxSearchTime;

    /**
     * Indicates whether the modem must report incremental results of the network scan
     * to the client.
     * FALSE – Incremental results must not be reported.
     * TRUE  – Incremental must be reported.
     */
    bool incrementalResults;

    /**
     * Indicates the periodicity with which the modem must report incremental results to
     * the client (in seconds).
     * Implementations may ignore this value if the incremental results are not requested.
     * This value must be less than or equal to maxSearchTime.
     * Range: IncrementalResultsPeriodicityRange:MIN to IncrementalResultsPeriodicityRange:MAX
     */
    int32_t incrementalResultsPeriodicity;

    /**
     * Describes the List of PLMN ids (MCC-MNC)
     * If any PLMN of this list is found, search must end at that point and results with all
     * PLMN found until that point should be sent as response.
     * If the list is not sent, search to be completed until end and all PLMNs found to be
     * reported.
     */
    vec<string> mccMncs;
};

enum ApnTypes : @1.4::ApnTypes {
    /**
     * APN type for XCAP
     * NOTE: Due to the addition of this new value, the value ALL defined in
     * 1.0::ApnTypes is deprecated and should not be used.
     */
    XCAP = 1 << 11,
};

/**
 * Overwritten from @1.4::DataProfileInfo to update ApnTypes to 1.5 version and replace mtu with
 * mtuV4 and mtuV6. In the future, this must be extended instead of overwritten.
 */
struct DataProfileInfo {
    /** ID of the data profile. */
    DataProfileId profileId;

    /** The APN name. */
    string apn;

    /** PDP_type values. */
    PdpProtocolType protocol;

    /** PDP_type values used on roaming network. */
    PdpProtocolType roamingProtocol;

    /** APN authentication type. */
    ApnAuthType authType;

    /** The username for APN, or empty string. */
    string user;

    /** The password for APN, or empty string. */
    string password;

    /** Data profile technology type. */
    DataProfileInfoType type;

    /** The period in seconds to limit the maximum connections. */
    int32_t maxConnsTime;

    /** The maximum connections during maxConnsTime. */
    int32_t maxConns;

    /**
     * The required wait time in seconds after a successful UE initiated disconnect of a given PDN
     * connection before the device can send a new PDN connection request for that given PDN.
     */
    int32_t waitTime;

    /** True to enable the profile, false to disable. */
    bool enabled;

    /** Supported APN types bitmap. See ApnTypes for the value of each bit. */
    bitfield<ApnTypes> supportedApnTypesBitmap;

    /** The bearer bitmap. See RadioAccessFamily for the value of each bit. */
    bitfield<RadioAccessFamily> bearerBitmap;

    /** Maximum transmission unit (MTU) size in bytes for IPv4. */
    int32_t mtuV4;

    /** Maximum transmission unit (MTU) size in bytes for IPv6. */
    int32_t mtuV6;

    /**
     * True if this data profile was used to bring up the last default (i.e internet) data
     * connection successfully.
     */
    bool preferred;

    /**
     * If true, modem must persist this data profile and profileId must not be
     * set to DataProfileId.INVALID. If the same data profile exists, this data profile must
     * overwrite it.
     */
    bool persistent;
};

/**
 * The properties of the link address. This enum reflects the definition in
 * if_addr.h in Linux kernel.
 */
enum AddressProperty : int32_t {
    NONE = 0,

    /** Indicates this address is deprecated */
    DEPRECATED = 0x20,
};

/**
 * Describes a data link address for mobile data connection.
 */
struct LinkAddress {
    /**
     * The format is IP address with optional "/"
     * prefix length (The format is defined in RFC-4291 section 2.3). For example, "192.0.1.3",
     * "192.0.1.11/16", or "2001:db8::1/64". Typically one IPv4 or one IPv6 or one of each. If
     * the prefix length is absent, then the addresses are assumed to be point to point with
     * IPv4 with prefix length 32 or IPv6 with prefix length 128.
     */
    string address;

    /**
     * The properties of the link address
     */
    bitfield<AddressProperty> properties;

    /**
     * The time, as reported by SystemClock.elapsedRealtime(), when this link address will be or
     * was deprecated. -1 indicates this information is not available. At the time existing
     * connections can still use this address until it expires, but new connections should use the
     * new address. LONG_MAX(0x7FFFFFFFFFFFFFFF) indicates this link address will never be
     * deprecated.
     */
    uint64_t deprecationTime;

    /**
     * The time, as reported by SystemClock.elapsedRealtime(), when this link address will expire
     * and be removed from the interface. -1 indicates this information is not available.
     * LONG_MAX(0x7FFFFFFFFFFFFFFF) indicates this link address will never expire.
     */
    uint64_t expirationTime;
};

/**
 * Overwritten from @1.4::SetupDataCallResult in order to update the addresses to 1.5 version.
 * In 1.5 the type of addresses changes to vector of LinkAddress, and mtu is replaced by
 * mtuV4 and mtuV6.
 */
struct SetupDataCallResult {
    /** Data call fail cause. DataCallFailCause.NONE if no error. */
    DataCallFailCause cause;

    /**
     * If status != DataCallFailCause.NONE, this field indicates the suggested retry back-off timer
     * value RIL wants to override the one pre-configured in FW. The unit is milliseconds.
     * The value < 0 means no value is suggested.
     * The value 0 means retry must be done ASAP.
     * The value of INT_MAX(0x7fffffff) means no retry.
     */
    int32_t suggestedRetryTime;

    /** Context ID, uniquely identifies this call. */
    int32_t cid;

    /** Data connection active status. */
    DataConnActiveStatus active;

    /**
     * PDP_type values. If cause is DataCallFailCause.ONLY_SINGLE_BEARER_ALLOWED, this is the type
     * supported such as "IP" or "IPV6".
     */
    PdpProtocolType type;

    /** The network interface name. */
    string ifname;

    /**
     * List of link address.
     */
    vec<LinkAddress> addresses;

    /**
     * List of DNS server addresses, e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1". Empty if no dns
     * server addresses returned.
     */
    vec<string> dnses;

    /**
     * List of default gateway addresses, e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1".
     * When empty, the addresses represent point to point connections.
     */
    vec<string> gateways;

    /**
     * List of P-CSCF(Proxy Call State Control Function) addresses via PCO(Protocol Configuration
     * Option), e.g., "2001:db8::1 2001:db8::2 2001:db8::3". Empty if not IMS client.
     */
    vec<string> pcscf;

    /**
     * MTU received from network for IPv4.
     * Value <= 0 means network has either not sent a value or sent an invalid value.
     */
    int32_t mtuV4;

    /**
     * MTU received from network for IPv6.
     * Value <= 0 means network has either not sent a value or sent an invalid value.
     */
    int32_t mtuV6;
};

enum Domain : int32_t {
    /** Circuit-switched */
    CS = 1 << 0,

    /** Packet-switched */
    PS = 1 << 1,
};

struct ClosedSubscriberGroupInfo {
    /**
     * Indicates whether the cell is restricted to only CSG members. A cell not broadcasting the
     * CSG Indication but reporting CSG information is considered a Hybrid Cell.
     * Refer to the "csg-Indication" field in 3GPP TS 36.331 section 6.2.2
     * SystemInformationBlockType1.
     * Also refer to "CSG Indicator" in 3GPP TS 25.331 section 10.2.48.8.1 and TS 25.304.
     */
    bool csgIndication;

    /**
     * The human-readable name of the closed subscriber group operating this cell.
     * Refer to "hnb-Name" in TS 36.331 section 6.2.2 SystemInformationBlockType9.
     * Also refer to "HNB Name" in 3GPP TS25.331 section 10.2.48.8.23 and TS 23.003 section 4.8.
     */
    string homeNodebName;

    /**
     * The identity of the closed subscriber group that the cell belongs to.
     * Refer to "CSG-Identity" in TS 36.336 section 6.3.4.
     * Also refer to "CSG Identity" in 3GPP TS 25.331 section 10.3.2.8 and TS 23.003 section 4.7.
     */
    int32_t csgIdentity;
};

safe_union OptionalCsgInfo {
    /**
     * If no CSG info is provided by the cell, then this structure shall be present.
     */
    Monostate noinit;

    /**
     * If CSG info is provided by the cell, this structure shall be present.
     */
    ClosedSubscriberGroupInfo csgInfo;
};

struct CellIdentityGsm {
    /**
     * The fields "mcc" and "mnc" must contain the PLMN-ID of the primary PLMN of this cell.
     */
    @1.2::CellIdentityGsm base;

    /** Additional PLMN-IDs beyond the primary PLMN broadcast for this cell */
    vec<string> additionalPlmns;
};

struct CellIdentityWcdma {
    /**
     * The fields "mcc" and "mnc" must contain the PLMN-ID of the primary PLMN of this cell.
     */
    @1.2::CellIdentityWcdma base;

    /** Additional PLMN-IDs beyond the primary PLMN broadcast for this cell */
    vec<string> additionalPlmns;

    /** Information about any closed subscriber group ID for this cell */
    OptionalCsgInfo optionalCsgInfo;
};

struct CellIdentityTdscdma {
    /**
     * The fields "mcc" and "mnc" must contain the PLMN-ID of the primary PLMN of this cell.
     */
    @1.2::CellIdentityTdscdma base;

    /** Additional PLMN-IDs beyond the primary PLMN broadcast for this cell */
    vec<string> additionalPlmns;

    /** Information about any closed subscriber group ID for this cell */
    OptionalCsgInfo optionalCsgInfo;
};

struct CellIdentityLte {
    /**
     * The fields "mcc" and "mnc" must contain the PLMN-ID of the primary PLMN of this cell.
     */
    @1.2::CellIdentityLte base;

    /** Additional PLMN-IDs beyond the primary PLMN broadcast for this cell */
    vec<string> additionalPlmns;

    /** Information about any closed subscriber group ID for this cell */
    OptionalCsgInfo optionalCsgInfo;

    /** Bands used by the cell. */
    vec<EutranBands> bands;
};

/**
 * The CellIdentity structure should be reported once for each element of the PLMN-IdentityInfoList
 * broadcast in SIB1 CellAccessRelatedInfo as per 3GPP TS 38.331 Section 6.3.2.
 */
struct CellIdentityNr {
    /**
     * The fields "mcc" and "mnc" must contain the PLMN-ID of the primary PLMN of this cell.
     */
    @1.4::CellIdentityNr base;

    /** Additional PLMN-IDs beyond the primary PLMN broadcast for this cell */
    vec<string> additionalPlmns;

    /** Bands used by the cell. */
    vec<NgranBands> bands;
};

struct CellInfoGsm {
    CellIdentityGsm cellIdentityGsm;
    GsmSignalStrength signalStrengthGsm;
};

struct CellInfoWcdma {
    CellIdentityWcdma cellIdentityWcdma;
    WcdmaSignalStrength signalStrengthWcdma;
};

struct CellInfoTdscdma {
    CellIdentityTdscdma cellIdentityTdscdma;
    TdscdmaSignalStrength signalStrengthTdscdma;
};

struct CellInfoLte {
    CellIdentityLte cellIdentityLte;
    LteSignalStrength signalStrengthLte;
};

struct CellInfoNr {
    CellIdentityNr cellIdentityNr;
    NrSignalStrength signalStrengthNr;
};

struct CellInfo {
    /**
     * True if this cell is registered false if not registered.
     */
    bool registered;
    /**
     * Type of time stamp represented by timeStamp.
     */
    TimeStampType timeStampType;
    /**
     * Time in nanos as returned by ril_nano_time.
     */
    uint64_t timeStamp;
    /**
     * Connection status for the cell.
     */
    CellConnectionStatus connectionStatus;

    safe_union CellInfoRatSpecificInfo {
        /**
         * 3gpp CellInfo types.
         */
        CellInfoGsm gsm;
        CellInfoWcdma wcdma;
        CellInfoTdscdma tdscdma;
        CellInfoLte lte;
        CellInfoNr nr;

        /**
         * 3gpp2 CellInfo types;
         */
        CellInfoCdma cdma;
    } ratSpecificInfo;
};

/** A union representing the CellIdentity of a single cell. */
safe_union CellIdentity {
    Monostate noinit;

    CellIdentityGsm gsm;
    CellIdentityWcdma wcdma;
    CellIdentityTdscdma tdscdma;
    CellIdentityCdma cdma;
    CellIdentityLte lte;
    CellIdentityNr nr;
};

struct BarringInfo {
    /**
     * Combined list of barring services for UTRAN, EUTRAN, and NGRAN.
     *
     * Barring information is defined in:
     * -UTRAN - 3gpp 25.331 Sec 10.2.48.8.6.
     * -EUTRAN - 3gpp 36.331 Sec 6.3.1 SystemInformationBlockType2
     * -NGRAN - 3gpp 38.331 Sec 6.3.2 UAC-BarringInfo and 22.261 Sec 6.22.2.[2-3]
     */
    enum ServiceType : int32_t {
        /** Applicable to UTRAN */
        /** Barring for all CS services, including registration */
        CS_SERVICE,
        /** Barring for all PS services, including registration */
        PS_SERVICE,
        /** Barring for mobile-originated circuit-switched voice calls */
        CS_VOICE,

        /** Applicable to EUTRAN, NGRAN */
        /** Barring for mobile-originated signalling for any purpose */
        MO_SIGNALLING,
        /** Barring for mobile-originated internet or other interactive data */
        MO_DATA,
        /** Barring for circuit-switched fallback calling */
        CS_FALLBACK,
        /** Barring for IMS voice calling */
        MMTEL_VOICE,
        /** Barring for IMS video calling */
        MMTEL_VIDEO,

        /** Applicable to UTRAN, EUTRAN, NGRAN */
        /** Barring for emergency services, either CS or emergency MMTEL */
        EMERGENCY,
        /** Barring for short message services */
        SMS,

        /** Operator-specific barring codes; applicable to NGRAN */
        OPERATOR_1 = 1001,
        OPERATOR_2 = 1002,
        OPERATOR_3 = 1003,
        OPERATOR_4 = 1004,
        OPERATOR_5 = 1005,
        OPERATOR_6 = 1006,
        OPERATOR_7 = 1007,
        OPERATOR_8 = 1008,
        OPERATOR_9 = 1009,
        OPERATOR_10 = 1010,
        OPERATOR_11 = 1011,
        OPERATOR_12 = 1012,
        OPERATOR_13 = 1013,
        OPERATOR_14 = 1014,
        OPERATOR_15 = 1015,
        OPERATOR_16 = 1016,
        OPERATOR_17 = 1017,
        OPERATOR_18 = 1018,
        OPERATOR_19 = 1019,
        OPERATOR_20 = 1020,
        OPERATOR_21 = 1021,
        OPERATOR_22 = 1022,
        OPERATOR_23 = 1023,
        OPERATOR_24 = 1024,
        OPERATOR_25 = 1025,
        OPERATOR_26 = 1026,
        OPERATOR_27 = 1027,
        OPERATOR_28 = 1028,
        OPERATOR_29 = 1029,
        OPERATOR_30 = 1030,
        OPERATOR_31 = 1031,
        OPERATOR_32 = 1032,
    } serviceType;

    /** The type of barring applied to the service */
    enum BarringType : int32_t {
        /** Device is not barred for the given service */
        NONE,
        /** Device may be barred based on time and probability factors */
        CONDITIONAL,
        /* Device is unconditionally barred */
        UNCONDITIONAL,
    } barringType;

    /** Type-specific barring info if applicable */
    safe_union BarringTypeSpecificInfo {
        /** Barring type is either none or unconditional */
        Monostate noinit;

        /** Must be included if barring is conditional */
        struct Conditional {
            /** The barring factor as a percentage 0-100 */
            int32_t factor;

            /** The number of seconds between re-evaluations of barring */
            int32_t timeSeconds;

            /**
             * Indicates whether barring is currently being applied.
             *
             * <p>True if the UE applies barring to a conditionally barred
             * service based on the conditional barring parameters.
             *
             * <p>False if the service is conditionally barred but barring
             * is not currently applied, which could be due to either the
             * barring criteria not having been evaluated (if the UE has not
             * attempted to use the service) or due to the criteria being
             * evaluated and the UE being permitted to use the service
             * despite conditional barring.
             */
            bool isBarred;
        } conditional;
    } barringTypeSpecificInfo;
};

enum IndicationFilter : @1.2::IndicationFilter {
    /** Control the unsolicited sending of registration failure reports via onRegistrationFailed */
    REGISTRATION_FAILURE = 1 << 5,
    /** Control the unsolicited sending of barring info updates via onBarringInfo */
    BARRING_INFO = 1 << 6,
};

/**
 * Call fail causes for Circuit-switched service enumerated in 3GPP TS 24.008, 10.5.3.6 and
 * 10.5.147. Additional detail is available in 3GPP TS 24.008 Annex G.
 */
enum RegistrationFailCause : int32_t {
    /** 0 - None */
    NONE = 0,
    /** 2 - IMSI unknown in HLR */
    IMSI_UNKNOWN_IN_HLR = 2,
    /** 3 - Illegal MS */
    ILLEGAL_MS = 3,
    /** 4 - Illegal ME */
    IMSI_UNKNOWN_IN_VLR = 4,
    /** 5 - PLMN not allowed */
    IMEI_NOT_ACCEPTED = 5,
    /** 6 - Location area not allowed */
    ILLEGAL_ME = 6,
    /** 7 - Roaming not allowed */
    GPRS_SERVICES_NOT_ALLOWED = 7,
    /** 8 - No Suitable Cells in this Location Area */
    GPRS_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 8,
    /** 9 - Network failure */
    MS_IDENTITY_CANNOT_BE_DERIVED_BY_NETWORK = 9,
    /** 10 - Persistent location update reject */
    IMPLICITLY_DETACHED = 10,
    /** 11 - PLMN not allowed */
    PLMN_NOT_ALLOWED = 11,
    /** 12 - Location area not allowed */
    LOCATION_AREA_NOT_ALLOWED = 12,
    /** 13 - Roaming not allowed in this Location Area */
    ROAMING_NOT_ALLOWED = 13,
    /** 14 - GPRS Services not allowed in this PLMN */
    GPRS_SERVICES_NOT_ALLOWED_IN_PLMN = 14,
    /** 15 - No Suitable Cells in this Location Area */
    NO_SUITABLE_CELLS = 15,
    /** 16 - MSC temporarily not reachable */
    MSC_TEMPORARILY_NOT_REACHABLE = 15,
    /** 17 - Network Failure */
    NETWORK_FAILURE = 17,
    /** 20 - MAC Failure */
    MAC_FAILURE = 20,
    /** 21 - Sync Failure */
    SYNC_FAILURE = 21,
    /** 22 - Congestion */
    CONGESTION = 22,
    /** 23 - GSM Authentication unacceptable */
    GSM_AUTHENTICATION_UNACCEPTABLE = 23,
    /** 25 - Not Authorized for this CSG */
    NOT_AUTHORIZED_FOR_THIS_CSG = 25,
    /** 28 SMS provided via GPRS in this routing area */
    SMS_PROVIDED_BY_GPRS_IN_ROUTING_AREA,
    /** 32 - Service option not supported */
    SERVICE_OPTION_NOT_SUPPORTED = 32,
    /** 33 - Requested service option not subscribed */
    SERVICE_OPTION_NOT_SUBSCRIBED = 33,
    /** 34 - Service option temporarily out of order */
    SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER = 34,
    /** 38 - Call cannot be identified */
    CALL_CANNOT_BE_IDENTIFIED = 38,
    /** 40 No PDP context activated */
    NO_PDP_CONTEXT_ACTIVATED = 40,
    /** 48-63 - Retry upon entry into a new cell */
    RETRY_UPON_ENTRY_INTO_NEW_CELL_1 = 48,
    RETRY_UPON_ENTRY_INTO_NEW_CELL_2 = 49,
    RETRY_UPON_ENTRY_INTO_NEW_CELL_3 = 50,
    RETRY_UPON_ENTRY_INTO_NEW_CELL_4 = 51,
    RETRY_UPON_ENTRY_INTO_NEW_CELL_5 = 52,
    RETRY_UPON_ENTRY_INTO_NEW_CELL_6 = 53,
    RETRY_UPON_ENTRY_INTO_NEW_CELL_7 = 54,
    RETRY_UPON_ENTRY_INTO_NEW_CELL_8 = 55,
    RETRY_UPON_ENTRY_INTO_NEW_CELL_9 = 56,
    RETRY_UPON_ENTRY_INTO_NEW_CELL_10 = 57,
    RETRY_UPON_ENTRY_INTO_NEW_CELL_11 = 58,
    RETRY_UPON_ENTRY_INTO_NEW_CELL_12 = 59,
    RETRY_UPON_ENTRY_INTO_NEW_CELL_13 = 60,
    RETRY_UPON_ENTRY_INTO_NEW_CELL_14 = 61,
    RETRY_UPON_ENTRY_INTO_NEW_CELL_15 = 62,
    RETRY_UPON_ENTRY_INTO_NEW_CELL_16 = 63,
    /** 95 - Semantically incorrect message */
    SEMANTICALLY_INCORRECT_MESSAGE = 95,
    /** 96 - Invalid mandatory information */
    INVALID_MANDATORY_INFORMATION = 96,
    /** 97 - Message type non-existent or not implemented */
    MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED = 97,
    /** 98 - Message type not compatible with protocol state */
    MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98,
    /** 99 - Information element non-existent or not implemented */
    INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED = 99,
    /** 100 - Conditional IE error */
    CONDITIONAL_IE_ERROR = 100,
    /** 101 - Message not compatible with protocol state */
    MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101,
    /** 111 - Protocol error, unspecified */
    PROTOCOL_ERROR_UNSPECIFIED = 111,
};

enum PrlIndicator : int32_t {
    NOT_REGISTERED = -1,
    NOT_IN_PRL = 0,
    IN_PRL = 1,
};

struct RegStateResult {
    /**
     * Registration state
     *
     * If the RAT is indicated as a GERAN, UTRAN, or CDMA2000 technology, this value reports
     * registration in the Circuit-switched domain.
     * If the RAT is indicated as an EUTRAN, NGRAN, or another technology that does not support
     * circuit-switched services, this value reports registration in the Packet-switched domain.
     */
    RegState regState;

    /**
     * Indicates the available voice radio technology, valid values as
     * defined by RadioTechnology.
     */
    RadioTechnology rat;

    /**
     * Cause code reported by the network in case registration fails. This will be a mobility
     * management cause code defined for MM, GMM, MME or equivalent as appropriate for the RAT.
     */
    RegistrationFailCause reasonForDenial;

    /** CellIdentity */
    CellIdentity cellIdentity;

    /**
     * The most-recent PLMN-ID upon which the UE registered (or attempted to register if a failure
     * is reported in the reasonForDenial field). This PLMN shall be in standard format consisting
     * of a 3 digit MCC concatenated with a 2 or 3 digit MNC.
     */
    string registeredPlmn;

    /**
     * Access-technology-specific registration information, such as for CDMA2000.
     */
    safe_union AccessTechnologySpecificInfo {
        Monostate noinit;

        struct Cdma2000RegistrationInfo {
            /**
             * Concurrent services support indicator. if registered on a CDMA system.
             * false - Concurrent services not supported,
             * true - Concurrent services supported
             */
            bool cssSupported;

            /**
             * TSB-58 Roaming Indicator if registered on a CDMA or EVDO system or -1 if not.
             * Valid values are 0-255.
             */
            int32_t roamingIndicator;

            /**
             * Indicates whether the current system is in the PRL if registered on a CDMA or EVDO
             * system or -1 if not. 0=not in the PRL, 1=in the PRL.
             */
            PrlIndicator systemIsInPrl;

            /**
             * Default Roaming Indicator from the PRL if registered on a CDMA or EVDO system or -1
             * if not.
             * Valid values are 0-255.
             */
            int32_t defaultRoamingIndicator;
        } cdmaInfo;

        struct EutranRegistrationInfo {
            /**
             * Network capabilities for voice over PS services. This info is valid only on LTE
             * network and must be present when device is camped on LTE. VopsInfo must be empty when
             * device is camped only on 2G/3G.
             */
            LteVopsInfo lteVopsInfo;

            /**
             * The parameters of NR 5G Non-Standalone. This value is only valid on E-UTRAN,
             * otherwise must be empty.
             */
            NrIndicators nrIndicators;
        } eutranInfo;
    } accessTechnologySpecificInfo;
};

/** Overwritten from @1.4::NetworkScanResult in order to update the CellInfo to 1.5 version. */
struct NetworkScanResult {
    /**
     * The status of the scan.
     */
    ScanStatus status;

    /**
     * The error code of the incremental result.
     */
    RadioError error;

    /**
     * List of network information as CellInfo.
     */
    vec<CellInfo> networkInfos;
};

/**
 * Additional personalization categories in addition to those specified in 3GPP TS 22.022 and
 * 3GPP2 C.S0068-0.
 */
enum PersoSubstate : @1.0::PersoSubstate {
    /**
     * The device is personalized using the content of the Service Provider Name (SPN) in the SIM
     * card.
     */
    SIM_SPN,
    SIM_SPN_PUK,
    /**
     * Service Provider and Equivalent Home PLMN
     * The device is personalized using both the content of the GID1 (equivalent to service provider
     * personalization) and the content of the Equivalent Home PLMN (EHPLMN) in the SIM card.
     * If the GID1 in the SIM is absent, then just the content of the Equivalent Home PLMN
     * is matched.
     */
    SIM_SP_EHPLMN,
    SIM_SP_EHPLMN_PUK,
    /**
     * Device is personalized using the first digits of the ICCID of the SIM card.
     */
    SIM_ICCID,
    SIM_ICCID_PUK,
    /**
     * Device is personalized using the content of the IMPI in the ISIM.
     */
    SIM_IMPI,
    SIM_IMPI_PUK,
    /**
     * Network Subset and Service Provider
     * Device is personalized using both the content of GID1 (equivalent to service provider
     * personalization) and the first digits of the IMSI (equivalent to network subset
     * personalization).
     */
    SIM_NS_SP,
    SIM_NS_SP_PUK,
};

/** Extended from @1.0::AppStatus to update PersoSubstate to 1.5 version. */
struct AppStatus {
    @1.0::AppStatus base;

    /** Applicable only if appState == SUBSCRIPTION_PERSO */
    PersoSubstate persoSubstate;
};


/** Extended from @1.4::CardStatus to use 1.5 version of AppStatus. */
struct CardStatus {
    @1.4::CardStatus base;

    /** size <= RadioConst::CARD_MAX_APPS */
    vec<AppStatus> applications;
};