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