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