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_IMPI_DONE, 93 MSG_SIM_OBTAIN_CSIM_SPN_DONE, 94 MSG_SIM_OBTAIN_IST_DONE, 95 }; 96 97 enum ElementaryFile { 98 // ETSI TS 102 221 V3.3.0 section 13.3 Preferred Languages 99 ELEMENTARY_FILE_PL = 0x2F05, 100 // CPHS V4.2 section B.3.1.1, B.4.1 - B.4.7 CPHS information Call forwarding flags and so on 101 ELEMENTARY_FILE_VOICE_MAIL_INDICATOR_CPHS = 0x6F11, 102 ELEMENTARY_FILE_CFF_CPHS = 0x6F13, 103 ELEMENTARY_FILE_SPN_CPHS = 0x6F14, 104 ELEMENTARY_FILE_CSP_CPHS = 0x6F15, 105 ELEMENTARY_FILE_INFO_CPHS = 0x6F16, 106 ELEMENTARY_FILE_MAILBOX_CPHS = 0x6F17, 107 ELEMENTARY_FILE_SPN_SHORT_CPHS = 0x6F18, 108 // 3GPP TS 51.011 V4.1.0 section 10 contents of the Elementary Files 109 ELEMENTARY_FILE_ICCID = 0x2FE2, 110 ELEMENTARY_FILE_IMG = 0x4F20, 111 ELEMENTARY_FILE_HPLMN = 0x6F31, 112 ELEMENTARY_FILE_SST = 0x6F38, 113 ELEMENTARY_FILE_ADN = 0x6F3A, 114 ELEMENTARY_FILE_FDN = 0x6F3B, 115 ELEMENTARY_FILE_SMS = 0x6F3C, 116 ELEMENTARY_FILE_GID1 = 0x6F3E, 117 ELEMENTARY_FILE_GID2 = 0x6F3F, 118 ELEMENTARY_FILE_MSISDN = 0x6F40, 119 ELEMENTARY_FILE_SPN = 0x6F46, 120 ELEMENTARY_FILE_SDN = 0x6F49, 121 ELEMENTARY_FILE_EXT1 = 0x6F4A, 122 ELEMENTARY_FILE_EXT2 = 0x6F4B, 123 ELEMENTARY_FILE_EXT3 = 0x6F4C, 124 ELEMENTARY_FILE_EXT4 = 0x6F4E, 125 ELEMENTARY_FILE_PLMN_W_ACT = 0x6F60, 126 ELEMENTARY_FILE_OPLMN_W_ACT = 0x6F61, 127 ELEMENTARY_FILE_HPLMN_W_ACT = 0x6F62, 128 ELEMENTARY_FILE_FPLMN = 0x6F7B, 129 ELEMENTARY_FILE_AD = 0x6FAD, 130 ELEMENTARY_FILE_PNN = 0x6FC5, 131 ELEMENTARY_FILE_OPL = 0x6FC6, 132 ELEMENTARY_FILE_MBDN = 0x6FC7, 133 ELEMENTARY_FILE_EXT6 = 0x6FC8, 134 ELEMENTARY_FILE_MBI = 0x6FC9, 135 ELEMENTARY_FILE_MWIS = 0x6FCA, 136 ELEMENTARY_FILE_CFIS = 0x6FCB, 137 // 3GPP TS 31.102 V3.5.0 section 4.7 files of ADF USIM 138 ELEMENTARY_FILE_PBR = 0x4F30, 139 ELEMENTARY_FILE_LI = 0x6F05, 140 // for usim extensiom 141 ELEMENTARY_FILE_EXT5 = 0x6F4E, 142 ELEMENTARY_FILE_SPDI = 0x6FCD, 143 ELEMENTARY_FILE_EHPLMN = 0x6FD9, 144 ELEMENTARY_FILE_LRPLMNSI = 0x6FDC, 145 ELEMENTARY_FILE_HPPLMN = 0x6F31, 146 ELEMENTARY_FILE_USIM_ADN = 0x4F3A, 147 ELEMENTARY_FILE_USIM_IAP = 0x4F3B, 148 // CDMA RUIM file ids from 3GPP2 C.S0023-0 149 ELEMENTARY_FILE_CST = 0x6F32, 150 ELEMENTARY_FILE_RUIM_SPN = 0x6F41, 151 ELEMENTARY_FILE_CSIM_LI = 0x6F3A, 152 ELEMENTARY_FILE_CSIM_SPN = 0x6F41, 153 ELEMENTARY_FILE_CSIM_MDN = 0x6F44, 154 ELEMENTARY_FILE_CSIM_IMSIM = 0x6F22, 155 ELEMENTARY_FILE_CSIM_CDMAHOME = 0x6F28, 156 ELEMENTARY_FILE_CSIM_EPRL = 0x6F5A, 157 ELEMENTARY_FILE_CSIM_MIPUPP = 0x6F4D, 158 // ISIM access 159 ELEMENTARY_FILE_IMPU = 0x6F04, 160 ELEMENTARY_FILE_IMPI = 0x6F02, 161 ELEMENTARY_FILE_DOMAIN = 0x6F03, 162 ELEMENTARY_FILE_IST = 0x6F07, 163 ELEMENTARY_FILE_PCSCF = 0x6F09 164 }; 165 166 // file controller constant 167 enum ControllerRequest { 168 CONTROLLER_REQ_READ_BINARY = 0xb0, 169 CONTROLLER_REQ_UPDATE_BINARY = 0xd6, 170 CONTROLLER_REQ_READ_RECORD = 0xb2, 171 CONTROLLER_REQ_UPDATE_RECORD = 0xdc, 172 CONTROLLER_REQ_SEEK = 0xa2, 173 CONTROLLER_REQ_GET_RESPONSE = 0xc0 174 }; 175 176 enum ElementaryFileTile { 177 ELEMENTARY_FILE_TYPE_TRANSPARENT = 0, 178 ELEMENTARY_FILE_TYPE_LINEAR_FIXED = 1, 179 ELEMENTARY_FILE_TYPE_CYCLIC = 3 180 }; 181 182 enum MainFile { 183 ICC_MASTER_FILE = 1, 184 ICC_DEDICATED_FILE = 2, 185 ICC_ELEMENTARY_FILE = 4 186 }; 187 188 enum ResponseFile { 189 GET_RESPONSE_ELEMENTARY_FILE_SIZE_BYTES = 15, 190 GET_RESPONSE_ELEMENTARY_FILE_IMG_SIZE_BYTES = 10 191 }; 192 193 // controller file type 194 enum SizeType { 195 SIZE_ONE_OF_FILE = 2, 196 SIZE_TWO_OF_FILE = 3, 197 TYPE_OF_FILE = 6, 198 STRUCTURE_OF_DATA = 13, 199 LENGTH_OF_RECORD = 14 200 }; 201 202 enum ControllerMessage { 203 MSG_SIM_OBTAIN_SIZE_OF_FIXED_ELEMENTARY_FILE_DONE = 1, 204 MSG_SIM_OBTAIN_FIXED_ELEMENTARY_FILE_DONE = 2, 205 MSG_SIM_OBTAIN_SIZE_OF_TRANSPARENT_ELEMENTARY_FILE_DONE = 3, 206 MSG_SIM_OBTAIN_TRANSPARENT_ELEMENTARY_FILE_DONE = 4, 207 MSG_SIM_OBTAIN_SIZE_OF_LINEAR_ELEMENTARY_FILE_DONE = 5, 208 MSG_SIM_UPDATE_TRANSPARENT_ELEMENTARY_FILE_DONE = 6, 209 MSG_SIM_UPDATE_LINEAR_FIXED_FILE_DONE = 7, 210 MSG_SIM_OBTAIN_ICON_DONE = 10 211 }; 212 213 enum { 214 INVALID_VALUE = -1, 215 BYTE_LENGTH = 8, 216 BYTE_VALUE = 0xFF 217 }; 218 219 enum LockMsg { 220 MSG_SIM_LOCKED_RECORDS_LOADED = 0xf3, 221 MSG_SIM_NETWORK_LOCKED_RECORDS_LOADED = 0xf4, 222 MSG_SIM_SPN_UPDATED = 0xf5 223 }; 224 225 enum SpnType { SPN_INVALID = -1, SPN_COND_PLMN = 1, SPN_COND = 2 }; 226 227 enum SpnShowType { 228 SPN_CONDITION_DISPLAY_SPN = 0x01, 229 SPN_CONDITION_DISPLAY_PLMN = 0x02 230 }; 231 232 enum ActiveState { 233 DEACTIVE = 0, 234 ACTIVE = 1 235 }; 236 237 enum CardShape { 238 ENTITY_CARD = 1, 239 VIRTUAL_CARD = 11 240 }; 241 242 enum CardStand { 243 NOT_MAIN = 0, 244 MAIN_CARD = 1 245 }; 246 247 enum IccStatus { 248 ICC_STATE_UNKNOWN = 0, 249 ICC_STATE_NOT_READY = 1, 250 ICC_STATE_ABSENT = 2, 251 ICC_STATE_READY = 3, 252 ICC_STATE_LOADED = 4, 253 ICC_STATE_IMSI = 5, 254 ICC_STATE_PIN = 6, 255 ICC_STATE_PUK = 7, 256 ICC_STATE_SIMLOCK = 8 257 }; 258 259 enum IccDiallingNumberConstant { 260 LOADER_ERROR = 200, 261 PARAMETER_INCORRECT = 201, 262 NAME_CHAR_POS = 36, 263 CSIM_SPN_OCTET = 0x00, 264 CSIM_SPN_7BIT_ASCII = 0x02, 265 CSIM_SPN_IA5 = 0x03, 266 CSIM_SPN_UNICODE_16 = 0x04, 267 CSIM_SPN_LATIN = 0x08, 268 CSIM_SPN_7BIT_ALPHABET = 0x09 269 }; 270 271 enum RadioProtocolEvent { 272 MSG_SIM_TIME_OUT_ACTIVE = 2000, 273 MSG_SIM_SET_ACTIVE = 2001, 274 MSG_SIM_FORGET_ALLDATA = 2002, 275 }; 276 } // namespace Telephony 277 } // namespace OHOS 278 #endif // OHOS_SIM_CONSTANT_H 279