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 OHOS_SIM_CONSTANT_H 17 #define OHOS_SIM_CONSTANT_H 18 19 namespace OHOS { 20 namespace Telephony { 21 enum ControllerType { 22 ICC_CONTROLLER_REQ_BASE = 0x16EFF0, 23 ICC_CONTROLLER_REQ_NONE, 24 ICC_CONTROLLER_REQ_SEND_RESPONSE 25 }; 26 27 // mnc Length type 28 enum MncType { 29 UNINITIALIZED_MNC = -1, 30 UNKNOWN_MNC = 0, 31 DEFAULT_MNC = 2 32 }; 33 34 enum MWIType { 35 MSG_SIM_MWI = 0, 36 MSG_SIM_CFI = 1, 37 MSG_SIM_SPN = 2 38 }; 39 40 enum StateMessage { 41 MSG_SIM_OBTAIN_ICC_FILE_DONE = 100, 42 MSG_ICC_REFRESH = 31, 43 MSG_SIM_APP_READY = 1 44 }; 45 46 enum CallForwardType { 47 ICC_CALL_FORWARD_TYPE_DISABLED = 0, 48 ICC_CALL_FORWARD_TYPE_ENABLED = 1, 49 ICC_CALL_FORWARD_TYPE_UNKNOWN = -1 50 }; 51 52 enum SimMessage { 53 MSG_ID_DEFAULT = 0, 54 MSG_SIM_OBTAIN_IMSI_DONE = 0x03, 55 MSG_SIM_OBTAIN_ICCID_DONE, 56 MSG_SIM_OBTAIN_MBI_DONE, 57 MSG_SIM_OBTAIN_MBDN_DONE, 58 MSG_SIM_OBTAIN_MWIS_DONE, 59 MSG_SIM_OBTAIN_VOICE_MAIL_INDICATOR_CPHS_DONE, 60 MSG_SIM_OBTAIN_AD_DONE, // Admin data 61 MSG_SIM_OBTAIN_MSISDN_DONE, 62 MSG_SIM_OBTAIN_CPHS_MAILBOX_DONE, 63 MSG_SIM_OBTAIN_SPN_DONE, 64 MSG_SIM_OBTAIN_LI_LANGUAGE_DONE, 65 MSG_SIM_OBTAIN_PL_LANGUAGE_DONE, 66 MSG_SIM_OBTAIN_SPDI_DONE, 67 MSG_SIM_UPDATE_DONE, 68 MSG_SIM_OBTAIN_PNN_DONE, 69 MSG_SIM_OBTAIN_SST_DONE, 70 MSG_SIM_OBTAIN_ALL_SMS_DONE, 71 MSG_SIM_MARK_SMS_READ_DONE, 72 MSG_SIM_SET_MBDN_DONE, 73 MSG_SIM_SMS_ON_SIM, 74 MSG_SIM_OBTAIN_SMS_DONE, 75 MSG_SIM_OBTAIN_CFF_DONE, 76 MSG_SIM_SET_CPHS_MAILBOX_DONE, 77 MSG_SIM_OBTAIN_INFO_CPHS_DONE, 78 MSG_SIM_SET_MSISDN_DONE, 79 MSG_SIM_OBTAIN_CFIS_DONE, 80 MSG_SIM_OBTAIN_CSP_CPHS_DONE, 81 MSG_SIM_OBTAIN_GID1_DONE, 82 MSG_SIM_OBTAIN_GID2_DONE, 83 MSG_SIM_OBTAIN_PLMN_W_ACT_DONE, 84 MSG_SIM_OBTAIN_OPLMN_W_ACT_DONE, 85 MSG_SIM_OBTAIN_HPLMN_W_ACT_DONE, 86 MSG_SIM_OBTAIN_EHPLMN_DONE, 87 MSG_SIM_OBTAIN_FPLMN_DONE, 88 MSG_SIM_OBTAIN_DEVICE_IDENTITY_DONE, 89 MSG_SIM_OBTAIN_CDMA_SUBSCRIPTION_DONE, 90 MSG_SIM_SMS_ON_RUIM, 91 MSG_SIM_OBTAIN_OPL_DONE, 92 MSG_SIM_OBTAIN_OPL5G_DONE, 93 MSG_SIM_OBTAIN_IMPI_DONE, 94 MSG_SIM_OBTAIN_CSIM_SPN_DONE, 95 MSG_SIM_OBTAIN_IST_DONE, 96 }; 97 98 enum ElementaryFile { 99 // ETSI TS 102 221 V3.3.0 section 13.3 Preferred Languages 100 ELEMENTARY_FILE_PL = 0x2F05, 101 // CPHS V4.2 section B.3.1.1, B.4.1 - B.4.7 CPHS information Call forwarding flags and so on 102 ELEMENTARY_FILE_VOICE_MAIL_INDICATOR_CPHS = 0x6F11, 103 ELEMENTARY_FILE_CFF_CPHS = 0x6F13, 104 ELEMENTARY_FILE_SPN_CPHS = 0x6F14, 105 ELEMENTARY_FILE_CSP_CPHS = 0x6F15, 106 ELEMENTARY_FILE_INFO_CPHS = 0x6F16, 107 ELEMENTARY_FILE_MAILBOX_CPHS = 0x6F17, 108 ELEMENTARY_FILE_SPN_SHORT_CPHS = 0x6F18, 109 // 3GPP TS 51.011 V4.1.0 section 10 contents of the Elementary Files 110 ELEMENTARY_FILE_ICCID = 0x2FE2, 111 ELEMENTARY_FILE_OPL5G = 0x4F08, 112 ELEMENTARY_FILE_IMG = 0x4F20, 113 ELEMENTARY_FILE_HPLMN = 0x6F31, 114 ELEMENTARY_FILE_SST = 0x6F38, 115 ELEMENTARY_FILE_ADN = 0x6F3A, 116 ELEMENTARY_FILE_FDN = 0x6F3B, 117 ELEMENTARY_FILE_SMS = 0x6F3C, 118 ELEMENTARY_FILE_GID1 = 0x6F3E, 119 ELEMENTARY_FILE_GID2 = 0x6F3F, 120 ELEMENTARY_FILE_MSISDN = 0x6F40, 121 ELEMENTARY_FILE_SPN = 0x6F46, 122 ELEMENTARY_FILE_SDN = 0x6F49, 123 ELEMENTARY_FILE_EXT1 = 0x6F4A, 124 ELEMENTARY_FILE_EXT2 = 0x6F4B, 125 ELEMENTARY_FILE_EXT3 = 0x6F4C, 126 ELEMENTARY_FILE_EXT4 = 0x6F4E, 127 ELEMENTARY_FILE_PLMN_W_ACT = 0x6F60, 128 ELEMENTARY_FILE_OPLMN_W_ACT = 0x6F61, 129 ELEMENTARY_FILE_HPLMN_W_ACT = 0x6F62, 130 ELEMENTARY_FILE_FPLMN = 0x6F7B, 131 ELEMENTARY_FILE_AD = 0x6FAD, 132 ELEMENTARY_FILE_PNN = 0x6FC5, 133 ELEMENTARY_FILE_OPL = 0x6FC6, 134 ELEMENTARY_FILE_MBDN = 0x6FC7, 135 ELEMENTARY_FILE_EXT6 = 0x6FC8, 136 ELEMENTARY_FILE_MBI = 0x6FC9, 137 ELEMENTARY_FILE_MWIS = 0x6FCA, 138 ELEMENTARY_FILE_CFIS = 0x6FCB, 139 // 3GPP TS 31.102 V3.5.0 section 4.7 files of ADF USIM 140 ELEMENTARY_FILE_PBR = 0x4F30, 141 ELEMENTARY_FILE_LI = 0x6F05, 142 // for usim extensiom 143 ELEMENTARY_FILE_EXT5 = 0x6F4E, 144 ELEMENTARY_FILE_SPDI = 0x6FCD, 145 ELEMENTARY_FILE_EHPLMN = 0x6FD9, 146 ELEMENTARY_FILE_LRPLMNSI = 0x6FDC, 147 ELEMENTARY_FILE_HPPLMN = 0x6F31, 148 ELEMENTARY_FILE_USIM_ADN = 0x4F3A, 149 ELEMENTARY_FILE_USIM_IAP = 0x4F3B, 150 // CDMA RUIM file ids from 3GPP2 C.S0023-0 151 ELEMENTARY_FILE_CST = 0x6F32, 152 ELEMENTARY_FILE_RUIM_SPN = 0x6F41, 153 ELEMENTARY_FILE_CSIM_LI = 0x6F3A, 154 ELEMENTARY_FILE_CSIM_SPN = 0x6F41, 155 ELEMENTARY_FILE_CSIM_MDN = 0x6F44, 156 ELEMENTARY_FILE_CSIM_IMSIM = 0x6F22, 157 ELEMENTARY_FILE_CSIM_CDMAHOME = 0x6F28, 158 ELEMENTARY_FILE_CSIM_EPRL = 0x6F5A, 159 ELEMENTARY_FILE_CSIM_MIPUPP = 0x6F4D, 160 // ISIM access 161 ELEMENTARY_FILE_IMPU = 0x6F04, 162 ELEMENTARY_FILE_IMPI = 0x6F02, 163 ELEMENTARY_FILE_DOMAIN = 0x6F03, 164 ELEMENTARY_FILE_IST = 0x6F07, 165 ELEMENTARY_FILE_PCSCF = 0x6F09 166 }; 167 168 // file controller constant 169 enum ControllerRequest { 170 CONTROLLER_REQ_READ_BINARY = 0xb0, 171 CONTROLLER_REQ_UPDATE_BINARY = 0xd6, 172 CONTROLLER_REQ_READ_RECORD = 0xb2, 173 CONTROLLER_REQ_UPDATE_RECORD = 0xdc, 174 CONTROLLER_REQ_SEEK = 0xa2, 175 CONTROLLER_REQ_GET_RESPONSE = 0xc0 176 }; 177 178 enum ElementaryFileTile { 179 ELEMENTARY_FILE_TYPE_TRANSPARENT = 0, 180 ELEMENTARY_FILE_TYPE_LINEAR_FIXED = 1, 181 ELEMENTARY_FILE_TYPE_CYCLIC = 3 182 }; 183 184 enum MainFile { 185 ICC_MASTER_FILE = 1, 186 ICC_DEDICATED_FILE = 2, 187 ICC_ELEMENTARY_FILE = 4 188 }; 189 190 enum ResponseFile { 191 GET_RESPONSE_ELEMENTARY_FILE_SIZE_BYTES = 15, 192 GET_RESPONSE_ELEMENTARY_FILE_IMG_SIZE_BYTES = 10 193 }; 194 195 // controller file type 196 enum SizeType { 197 SIZE_ONE_OF_FILE = 2, 198 SIZE_TWO_OF_FILE = 3, 199 TYPE_OF_FILE = 6, 200 STRUCTURE_OF_DATA = 13, 201 LENGTH_OF_RECORD = 14 202 }; 203 204 enum ControllerMessage { 205 MSG_SIM_OBTAIN_SIZE_OF_FIXED_ELEMENTARY_FILE_DONE = 1, 206 MSG_SIM_OBTAIN_FIXED_ELEMENTARY_FILE_DONE = 2, 207 MSG_SIM_OBTAIN_SIZE_OF_TRANSPARENT_ELEMENTARY_FILE_DONE = 3, 208 MSG_SIM_OBTAIN_TRANSPARENT_ELEMENTARY_FILE_DONE = 4, 209 MSG_SIM_OBTAIN_SIZE_OF_LINEAR_ELEMENTARY_FILE_DONE = 5, 210 MSG_SIM_UPDATE_TRANSPARENT_ELEMENTARY_FILE_DONE = 6, 211 MSG_SIM_UPDATE_LINEAR_FIXED_FILE_DONE = 7, 212 MSG_SIM_OBTAIN_ICON_DONE = 10 213 }; 214 215 enum { 216 INVALID_VALUE = -1, 217 BYTE_LENGTH = 8, 218 BYTE_VALUE = 0xFF 219 }; 220 221 enum LockMsg { 222 MSG_SIM_LOCKED_RECORDS_LOADED = 0xf3, 223 MSG_SIM_NETWORK_LOCKED_RECORDS_LOADED = 0xf4, 224 MSG_SIM_SPN_UPDATED = 0xf5 225 }; 226 227 enum SpnType { SPN_INVALID = -1, SPN_COND_PLMN = 1, SPN_COND = 2 }; 228 229 enum SpnShowType { 230 SPN_CONDITION_DISPLAY_SPN = 0x01, 231 SPN_CONDITION_DISPLAY_PLMN = 0x02 232 }; 233 234 enum ActiveState { 235 DEACTIVE = 0, 236 ACTIVE = 1 237 }; 238 239 enum CardShape { 240 ENTITY_CARD = 1, 241 VIRTUAL_CARD = 11 242 }; 243 244 enum CardStand { 245 NOT_MAIN = 0, 246 MAIN_CARD = 1 247 }; 248 249 enum IccStatus { 250 ICC_STATE_UNKNOWN = 0, 251 ICC_STATE_NOT_READY = 1, 252 ICC_STATE_ABSENT = 2, 253 ICC_STATE_READY = 3, 254 ICC_STATE_LOADED = 4, 255 ICC_STATE_IMSI = 5, 256 ICC_STATE_PIN = 6, 257 ICC_STATE_PUK = 7, 258 ICC_STATE_SIMLOCK = 8 259 }; 260 261 enum IccDiallingNumberConstant { 262 LOADER_ERROR = 200, 263 PARAMETER_INCORRECT = 201, 264 NAME_CHAR_POS = 36, 265 CSIM_SPN_OCTET = 0x00, 266 CSIM_SPN_7BIT_ASCII = 0x02, 267 CSIM_SPN_IA5 = 0x03, 268 CSIM_SPN_UNICODE_16 = 0x04, 269 CSIM_SPN_LATIN = 0x08, 270 CSIM_SPN_7BIT_ALPHABET = 0x09 271 }; 272 273 enum RadioProtocolEvent { 274 MSG_SIM_TIME_OUT_ACTIVE = 2000, 275 MSG_SIM_SET_ACTIVE = 2001, 276 MSG_SIM_FORGET_ALLDATA = 2002, 277 }; 278 279 enum VoiceMailConstant { 280 DEFAULT_VOICE_MAIL_COUNT = -2, 281 UNKNOWN_VOICE_MAIL_COUNT = -1, 282 }; 283 284 enum CallForwardingStatus { 285 CALL_FORWARDING_STATUS_DISABLED = 0, 286 CALL_FORWARDING_STATUS_ENABLED = 1, 287 CALL_FORWARDING_STATUS_UNKNOWN = -1, 288 }; 289 } // namespace Telephony 290 } // namespace OHOS 291 #endif // OHOS_SIM_CONSTANT_H 292