1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef NAPI_RADIO_TYPES_H
17 #define NAPI_RADIO_TYPES_H
18 
19 #include <cstdint>
20 
21 #include "signal_information.h"
22 
23 namespace OHOS {
24 namespace Telephony {
25 enum class NetworkType : int32_t {
26     /**
27      * Indicates unknown network type.
28      */
29     NETWORK_TYPE_UNKNOWN,
30 
31     /**
32      * Indicates that the network type is GSM.
33      */
34     NETWORK_TYPE_GSM,
35 
36     /**
37      * Indicates that the network type is CDMA.
38      */
39     NETWORK_TYPE_CDMA,
40 
41     /**
42      * Indicates that the network type is WCDMA.
43      */
44     NETWORK_TYPE_WCDMA,
45 
46     /**
47      * Indicates that the network type is TD-SCDMA.
48      */
49     NETWORK_TYPE_TDSCDMA,
50 
51     /**
52      * Indicates that the network type is LTE.
53      */
54     NETWORK_TYPE_LTE,
55 
56     /**
57      * Indicates that the network type is 5G NR.
58      */
59     NETWORK_TYPE_NR
60 };
61 
62 enum class RatType : int32_t {
63     /**
64      * Indicates the invalid value.
65      */
66     RADIO_TECHNOLOGY_INVALID = -1,
67 
68     /**
69      * Indicates unknown radio access technology (RAT).
70      */
71     RADIO_TECHNOLOGY_UNKNOWN = 0,
72 
73     /**
74      * Indicates that RAT is global system for mobile communications (GSM),
75      * including GSM, general packet radio system (GPRS), and enhanced data rates
76      * for GSM evolution (EDGE).
77      */
78     RADIO_TECHNOLOGY_GSM = 1,
79 
80     /**
81      * Indicates that RAT is code division multiple access (CDMA), including
82      * Interim Standard 95 (IS95) and Single-Carrier Radio Transmission Technology
83      * (1xRTT).
84      */
85     RADIO_TECHNOLOGY_1XRTT = 2,
86 
87     /**
88      * Indicates that RAT is wideband code division multiple address (WCDMA).
89      */
90     RADIO_TECHNOLOGY_WCDMA = 3,
91 
92     /**
93      * Indicates that RAT is high-speed packet access (HSPA), including HSPA,
94      * high-speed downlink packet access (HSDPA), and high-speed uplink packet
95      * access (HSUPA).
96      */
97     RADIO_TECHNOLOGY_HSPA = 4,
98 
99     /**
100      * Indicates that RAT is evolved high-speed packet access (HSPA+), including
101      * HSPA+ and dual-carrier HSPA+ (DC-HSPA+).
102      */
103     RADIO_TECHNOLOGY_HSPAP = 5,
104 
105     /**
106      * Indicates that RAT is time division-synchronous code division multiple
107      * access (TD-SCDMA).
108      */
109     RADIO_TECHNOLOGY_TD_SCDMA = 6,
110 
111     /**
112      * Indicates that RAT is evolution data only (EVDO), including EVDO Rev.0,
113      * EVDO Rev.A, and EVDO Rev.B.
114      */
115     RADIO_TECHNOLOGY_EVDO = 7,
116 
117     /**
118      * Indicates that RAT is evolved high rate packet data (EHRPD).
119      */
120     RADIO_TECHNOLOGY_EHRPD = 8,
121 
122     /**
123      * Indicates that RAT is long term evolution (LTE).
124      */
125     RADIO_TECHNOLOGY_LTE = 9,
126 
127     /**
128      * Indicates that RAT is LTE carrier aggregation (LTE-CA).
129      */
130     RADIO_TECHNOLOGY_LTE_CA = 10,
131 
132     /**
133      * Indicates that RAT is interworking WLAN (I-WLAN).
134      */
135     RADIO_TECHNOLOGY_IWLAN = 11,
136 
137     /**
138      * Indicates that RAT is 5G new radio (NR).
139      */
140     RADIO_TECHNOLOGY_NR = 12,
141 
142     /**
143      * Indicates the max value.
144      */
145     RADIO_TECHNOLOGY_MAX = RADIO_TECHNOLOGY_NR,
146 };
147 
148 enum class NsaState : int32_t {
149     /**
150      * Indicates that a device is idle under or is connected to an LTE cell that does not support NSA.
151      */
152     NSA_STATE_NOT_SUPPORT = 1,
153 
154     /**
155      * Indicates that a device is idle under an LTE cell supporting NSA but not NR coverage detection.
156      */
157     NSA_STATE_NO_DETECT = 2,
158 
159     /**
160      * Indicates that a device is connected to an LTE network under an LTE cell
161      * that supports NSA and NR coverage detection.
162      */
163     NSA_STATE_CONNECTED_DETECT = 3,
164 
165     /**
166      * Indicates that a device is idle under an LTE cell supporting NSA and NR coverage detection.
167      */
168     NSA_STATE_IDLE_DETECT = 4,
169 
170     /**
171      * Indicates that a device is connected to an LTE + NR network under an LTE cell that supports NSA.
172      */
173     NSA_STATE_DUAL_CONNECTED = 5,
174 
175     /**
176      * Indicates that a device is idle under or is connected to an NG-RAN cell while being attached to 5GC.
177      */
178     NSA_STATE_SA_ATTACHED = 6
179 };
180 
181 enum RegStatus {
182     /**
183      * Indicates a state in which a device cannot use any service.
184      */
185     REGISTRATION_STATE_NO_SERVICE = 0,
186 
187     /**
188      * Indicates a state in which a device can use services properly.
189      */
190     REGISTRATION_STATE_IN_SERVICE = 1,
191 
192     /**
193      * Indicates a state in which a device can use only the emergency call service.
194      */
195     REGISTRATION_STATE_EMERGENCY_CALL_ONLY = 2,
196 
197     /**
198      * Indicates that the cellular radio is powered off.
199      */
200     REGISTRATION_STATE_POWER_OFF = 3
201 };
202 
203 enum NetworkCapabilityType {
204     /**
205      * Indicates LTE network switch type.
206      *
207      * @syscap SystemCapability.Telephony.CoreService
208      * @since 10
209      */
210     SERVICE_TYPE_LTE,
211 
212     /**
213      * Indicates NR network switch type.
214      *
215      * @syscap SystemCapability.Telephony.CoreService
216      * @since 10
217      */
218     SERVICE_TYPE_NR,
219 };
220 
221 enum NetworkCapabilityState {
222     /**
223      * Indicates turn off network switch.
224      *
225      * @syscap SystemCapability.Telephony.CoreService
226      * @since 10
227      */
228     SERVICE_CAPABILITY_OFF,
229 
230     /**
231      * Indicates turn on network switch.
232      *
233      * @syscap SystemCapability.Telephony.CoreService
234      * @since 10
235      */
236     SERVICE_CAPABILITY_ON,
237 };
238 } // namespace Telephony
239 } // namespace OHOS
240 #endif // NAPI_RADIO_TYPES_H