• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 NETWORK_SEARCH_TYPES_H
17 #define NETWORK_SEARCH_TYPES_H
18 
19 #include "parcel.h"
20 
21 namespace OHOS {
22 namespace Telephony {
23 constexpr const char *CUR_SLOT_ID = "CUR_SLOT_ID";
24 constexpr const char *CUR_PLMN_SHOW = "CUR_PLMN_SHOW";
25 constexpr const char *CUR_PLMN = "CUR_PLMN";
26 constexpr const char *CUR_SPN_SHOW = "CUR_SPN_SHOW";
27 constexpr const char *CUR_SPN = "CUR_SPN";
28 constexpr int32_t RRC_CONNECTED_STATUS = 1;
29 constexpr int32_t RRC_IDLE_STATUS = 0;
30 
31 /**
32  * @brief Domain type
33  */
34 enum class DomainType {
35     /**
36      * Packet Switched (PS) domain
37      */
38     DOMAIN_TYPE_PS,
39     /**
40      * Circuit Switched (CS) domain
41      */
42     DOMAIN_TYPE_CS,
43 };
44 
45 enum class RegServiceState {
46     REG_STATE_UNKNOWN,
47     REG_STATE_IN_SERVICE,
48     REG_STATE_NO_SERVICE,
49     REG_STATE_EMERGENCY_ONLY,
50     REG_STATE_SEARCH,
51     REG_STATE_POWER_OFF
52 };
53 
54 /**
55  * @brief Registered roaming type
56  */
57 enum class RoamingType {
58     /**
59      * Registered in a roaming network, but unknown the roaming type
60      */
61     ROAMING_STATE_UNKNOWN,
62     /**
63      * Not roaming
64      */
65     ROAMING_STATE_UNSPEC,
66     /**
67      * Registered in a domestic roaming network
68      */
69     ROAMING_STATE_DOMESTIC,
70     /**
71      * Registered in an international roaming network
72      */
73     ROAMING_STATE_INTERNATIONAL
74 };
75 
76 /**
77  * @brief Describes the radio access technology.
78  */
79 enum class RadioTech {
80     /**
81      * Indicates the invalid value.
82      */
83     RADIO_TECHNOLOGY_INVALID = -1,
84 
85     /**
86      * Indicates unknown radio access technology (RAT).
87      */
88     RADIO_TECHNOLOGY_UNKNOWN = 0,
89 
90     /**
91      * Indicates that RAT is global system for mobile communications (GSM), including GSM, general packet
92      * radio system (GPRS), and enhanced data rates for GSM evolution (EDGE).
93      */
94     RADIO_TECHNOLOGY_GSM = 1,
95 
96     /**
97      * Indicates that RAT is code division multiple access (CDMA), including Interim Standard 95 (IS95) and
98      * Single-Carrier Radio Transmission Technology (1xRTT).
99      */
100     RADIO_TECHNOLOGY_1XRTT = 2,
101 
102     /**
103      * Indicates that RAT is wideband code division multiple address (WCDMA).
104      */
105     RADIO_TECHNOLOGY_WCDMA = 3,
106 
107     /**
108      * Indicates that RAT is high-speed packet access (HSPA), including HSPA, high-speed downlink packet
109      * access (HSDPA), and high-speed uplink packet access (HSUPA).
110      */
111     RADIO_TECHNOLOGY_HSPA = 4,
112 
113     /**
114      * Indicates that RAT is evolved high-speed packet access (HSPA+), including HSPA+ and dual-carrier
115      * HSPA+ (DC-HSPA+).
116      */
117     RADIO_TECHNOLOGY_HSPAP = 5,
118 
119     /**
120      * Indicates that RAT is time division-synchronous code division multiple access (TD-SCDMA).
121      */
122     RADIO_TECHNOLOGY_TD_SCDMA = 6,
123 
124     /**
125      * Indicates that RAT is evolution data only (EVDO), including EVDO Rev.0, EVDO Rev.A, and EVDO Rev.B.
126      */
127     RADIO_TECHNOLOGY_EVDO = 7,
128 
129     /**
130      * Indicates that RAT is evolved high rate packet data (EHRPD).
131      */
132     RADIO_TECHNOLOGY_EHRPD = 8,
133 
134     /**
135      * Indicates that RAT is long term evolution (LTE).
136      */
137     RADIO_TECHNOLOGY_LTE = 9,
138 
139     /**
140      * Indicates that RAT is LTE carrier aggregation (LTE-CA).
141      */
142     RADIO_TECHNOLOGY_LTE_CA = 10,
143 
144     /**
145      * Indicates that RAT is interworking WLAN (I-WLAN).
146      */
147     RADIO_TECHNOLOGY_IWLAN = 11,
148 
149     /**
150      * Indicates that RAT is 5G new radio (NR).
151      */
152     RADIO_TECHNOLOGY_NR = 12,
153 
154     /**
155      * Indicates the max value.
156      */
157     RADIO_TECHNOLOGY_MAX = RADIO_TECHNOLOGY_NR,
158 };
159 
160 /**
161  * @brief Describes the nsa sa state.
162  */
163 enum class NrState {
164     /**
165      * Indicates that a device is idle under or is connected to an LTE cell that does not support NSA.
166      */
167     NR_STATE_NOT_SUPPORT = 1,
168 
169     /**
170      * Indicates that a device is idle under an LTE cell supporting NSA but not NR coverage detection.
171      */
172     NR_NSA_STATE_NO_DETECT = 2,
173 
174     /**
175      * Indicates that a device is connected to an LTE network under an LTE cell
176      * that supports NSA and NR coverage detection.
177      */
178     NR_NSA_STATE_CONNECTED_DETECT = 3,
179 
180     /**
181      * Indicates that a device is idle under an LTE cell supporting NSA and NR coverage detection.
182      */
183     NR_NSA_STATE_IDLE_DETECT = 4,
184 
185     /**
186      * Indicates that a device is connected to an LTE + NR network under an LTE cell that supports NSA.
187      */
188     NR_NSA_STATE_DUAL_CONNECTED = 5,
189 
190     /**
191      * Indicates that a device is idle under or is connected to an NG-RAN cell while being attached to 5GC.
192      */
193     NR_NSA_STATE_SA_ATTACHED = 6
194 };
195 
196 /**
197  * @brief Describes the 5G New Radio (NR) mode.
198  */
199 enum class NrMode {
200     /**
201      * Indicates unknown NR networking mode.
202      */
203     NR_MODE_UNKNOWN,
204 
205     /**
206      * Indicates that the NR networking mode is NSA only.
207      */
208     NR_MODE_NSA_ONLY,
209 
210     /**
211      * Indicates that the NR networking mode is SA only.
212      */
213     NR_MODE_SA_ONLY,
214 
215     /**
216      * Indicates that the NR networking mode is NSA and SA.
217      */
218     NR_MODE_NSA_AND_SA,
219 };
220 
221 /**
222  * @brief Describes the frequency type.
223  */
224 enum class FrequencyType {
225     FREQ_TYPE_UNKNOWN = 0,
226     /**
227      * Frequency range is millimeter wave frequency.
228      */
229     FREQ_TYPE_MMWAVE
230 };
231 
232 enum class PhoneType { PHONE_TYPE_IS_NONE, PHONE_TYPE_IS_GSM, PHONE_TYPE_IS_CDMA };
233 
234 enum class SelectionMode { MODE_TYPE_UNKNOWN = -1, MODE_TYPE_AUTO = 0, MODE_TYPE_MANUAL = 1 };
235 
236 enum class PreferredNetworkMode {
237     CORE_NETWORK_MODE_AUTO = 0,
238     CORE_NETWORK_MODE_GSM = 1,
239     CORE_NETWORK_MODE_WCDMA = 2,
240     CORE_NETWORK_MODE_LTE = 3,
241     CORE_NETWORK_MODE_LTE_WCDMA = 4,
242     CORE_NETWORK_MODE_LTE_WCDMA_GSM = 5,
243     CORE_NETWORK_MODE_WCDMA_GSM = 6,
244     CORE_NETWORK_MODE_CDMA = 7,
245     CORE_NETWORK_MODE_EVDO = 8,
246     CORE_NETWORK_MODE_EVDO_CDMA = 9,
247     CORE_NETWORK_MODE_WCDMA_GSM_EVDO_CDMA = 10,
248     CORE_NETWORK_MODE_LTE_EVDO_CDMA = 11,
249     CORE_NETWORK_MODE_LTE_WCDMA_GSM_EVDO_CDMA = 12,
250     CORE_NETWORK_MODE_TDSCDMA = 13,
251     CORE_NETWORK_MODE_TDSCDMA_GSM = 14,
252     CORE_NETWORK_MODE_TDSCDMA_WCDMA = 15,
253     CORE_NETWORK_MODE_TDSCDMA_WCDMA_GSM = 16,
254     CORE_NETWORK_MODE_LTE_TDSCDMA = 17,
255     CORE_NETWORK_MODE_LTE_TDSCDMA_GSM = 18,
256     CORE_NETWORK_MODE_LTE_TDSCDMA_WCDMA = 19,
257     CORE_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM = 20,
258     CORE_NETWORK_MODE_TDSCDMA_WCDMA_GSM_EVDO_CDMA = 21,
259     CORE_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA = 22,
260     CORE_NETWORK_MODE_NR = 31,
261     CORE_NETWORK_MODE_NR_LTE = 32,
262     CORE_NETWORK_MODE_NR_LTE_WCDMA = 33,
263     CORE_NETWORK_MODE_NR_LTE_WCDMA_GSM = 34,
264     CORE_NETWORK_MODE_NR_LTE_EVDO_CDMA = 35,
265     CORE_NETWORK_MODE_NR_LTE_WCDMA_GSM_EVDO_CDMA = 36,
266     CORE_NETWORK_MODE_NR_LTE_TDSCDMA = 37,
267     CORE_NETWORK_MODE_NR_LTE_TDSCDMA_GSM = 38,
268     CORE_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA = 39,
269     CORE_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM = 40,
270     CORE_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA = 41,
271     CORE_NETWORK_MODE_MAX_VALUE = 99,
272 };
273 
274 struct OperatorInformation {
275     std::string operatorNumeric = "";
276     std::string fullName = "";
277     std::string shortName = "";
278 };
279 
280 enum class RadioProtocolTech {
281     RADIO_PROTOCOL_TECH_UNKNOWN = 1 << static_cast<int32_t>(RadioTech::RADIO_TECHNOLOGY_UNKNOWN),
282     RADIO_PROTOCOL_TECH_GSM = 1 << static_cast<int32_t>(RadioTech::RADIO_TECHNOLOGY_GSM),
283     RADIO_PROTOCOL_TECH_1XRTT = 1 << static_cast<int32_t>(RadioTech::RADIO_TECHNOLOGY_1XRTT),
284     RADIO_PROTOCOL_TECH_WCDMA = 1 << static_cast<int32_t>(RadioTech::RADIO_TECHNOLOGY_WCDMA),
285     RADIO_PROTOCOL_TECH_HSPA = 1 << static_cast<int32_t>(RadioTech::RADIO_TECHNOLOGY_HSPA),
286     RADIO_PROTOCOL_TECH_HSPAP = 1 << static_cast<int32_t>(RadioTech::RADIO_TECHNOLOGY_HSPAP),
287     RADIO_PROTOCOL_TECH_TD_SCDMA = 1 << static_cast<int32_t>(RadioTech::RADIO_TECHNOLOGY_TD_SCDMA),
288     RADIO_PROTOCOL_TECH_EVDO = 1 << static_cast<int32_t>(RadioTech::RADIO_TECHNOLOGY_EVDO),
289     RADIO_PROTOCOL_TECH_EHRPD = 1 << static_cast<int32_t>(RadioTech::RADIO_TECHNOLOGY_EHRPD),
290     RADIO_PROTOCOL_TECH_LTE = 1 << static_cast<int32_t>(RadioTech::RADIO_TECHNOLOGY_LTE),
291     RADIO_PROTOCOL_TECH_LTE_CA = 1 << static_cast<int32_t>(RadioTech::RADIO_TECHNOLOGY_LTE_CA),
292     RADIO_PROTOCOL_TECH_IWLAN = 1 << static_cast<int32_t>(RadioTech::RADIO_TECHNOLOGY_IWLAN),
293     RADIO_PROTOCOL_TECH_NR = 1 << static_cast<int32_t>(RadioTech::RADIO_TECHNOLOGY_NR),
294 };
295 } // namespace Telephony
296 } // namespace OHOS
297 #endif // NETWORK_SEARCH_TYPES_H
298