1 /* 2 * Copyright (C) 2024 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_TEL_RIL_SMS_PARCEL_H 17 #define OHOS_TEL_RIL_SMS_PARCEL_H 18 19 #include "tel_ril_base_parcel.h" 20 #include "tel_ril_enum.h" 21 22 namespace OHOS { 23 namespace Telephony { 24 /** 25 * @brief Defines a GSM SMS message. 26 */ 27 struct GsmSmsMessageInfo { 28 /** Request serial number. */ 29 int32_t serial = 0; 30 31 /** Short Message Service Center Protocol Data Unit see GSM 03.40 */ 32 std::string smscPdu = ""; 33 34 /** Protocol Data Unit */ 35 std::string pdu = ""; 36 37 /** GSM SMS Status. */ 38 int32_t state = 0; 39 }; 40 41 /** 42 * @brief Defines a CDMA SMS message. 43 */ 44 struct SendCdmaSmsMessageInfo { 45 /** Request serial number. */ 46 int32_t serial = 0; 47 48 /** Short Message Service Center Protocol Data Unit see GSM 03.40 */ 49 std::string smscPdu = ""; 50 51 /** CDMA SMS Status. */ 52 int32_t state = 0; 53 }; 54 55 /** 56 * @brief Defines the SMS message information in a SIM card. 57 */ 58 struct SmsMessageIOInfo { 59 /** Request serial number. */ 60 int32_t serial = 0; 61 62 /** Short Message Service Center Protocol Data Unit see GSM 03.40. */ 63 std::string smscPdu = ""; 64 65 /** Protocol Data Unit */ 66 std::string pdu = ""; 67 68 /** The status of SMS message information in a SIM card. */ 69 int32_t state = 0; 70 71 /** Message index. */ 72 int32_t index = 0; 73 }; 74 75 /** 76 * @brief Defines the SMSC address information. 77 */ 78 struct ServiceCenterAddress { 79 /** Request serial number. */ 80 int32_t serial = 0; 81 82 /** SMSC address type. For details, see 3GPP TS 24.011 [6]. */ 83 int32_t tosca = 0; 84 85 /** Protocol Data Unit */ 86 std::string address = ""; 87 }; 88 89 /** 90 * @brief Defines the GSM cell broadcast configuration information in 3GPP 91 * TS 27.005 AT+CSCB = [<mode>[,<mids>[,<dcss>]]]. 92 */ 93 struct CBConfigInfo { 94 /** Request serial number. */ 95 int32_t serial = 0; 96 97 /** Mode (activated or not). */ 98 int32_t mode = 0; 99 100 /** 101 * Response type: 102 * 0: query and report 103 * 1: report 104 */ 105 int32_t indicationType = 0; 106 107 /** Message IDs. */ 108 std::string mids = ""; 109 110 /** Data coding schemes. */ 111 std::string dcss = ""; 112 }; 113 114 /** 115 * @brief Defines the CDMA cell broadcast configuration information. 116 */ 117 struct CdmaCBConfigInfo { 118 /** Service. */ 119 int32_t service = 0; 120 121 /** Language. */ 122 int32_t language = 0; 123 124 /** Selected or not. */ 125 int32_t checked = 0; 126 }; 127 128 /** 129 * @brief Defines the CDMA cell broadcast configuration information list. 130 */ 131 struct CdmaCBConfigInfoList { 132 /** Request serial number. */ 133 int32_t serial = 0; 134 135 /** The size of CB config information list. */ 136 int32_t size = 0; 137 138 /** CB config information list. */ 139 std::vector<CdmaCBConfigInfo> list {}; 140 }; 141 142 /** 143 * @brief Defines the cell broadcast report information. 144 * 145 * From 3GPP TS 27.005 if text mode (+CMGF=1): 146 * <CR><LF>+CBM: 147 * <sn>,<mid>,<dcs>,<page>,<pages><CR><LF><data><CR> 148 * <LF> if PDU mode 149 * (+CMGF=0): 150 * <CR><LF>+CBM: <length><CR><LF><pdu><CR><LF> 151 */ 152 struct CBConfigReportInfo { 153 /** 154 * Response type: 155 * 0: query and report 156 * 1: report 157 */ 158 int32_t indicationType = 0; 159 160 /** Cell broadcast SN */ 161 int32_t sn = 0; 162 163 /** Message IDs */ 164 int32_t mid = 0; 165 166 /** Cell broadcast page number. */ 167 int32_t page = 0; 168 169 /** Total number of cell broadcast pages. */ 170 int32_t pages = 0; 171 172 /** Data coding schemes. */ 173 std::string dcs = ""; 174 175 /** Decoded cell broadcast content. */ 176 std::string data = ""; 177 178 /** Number of PDU bytes. */ 179 int32_t length = 0; 180 181 /** Protocol data unit. */ 182 std::string pdu = ""; 183 }; 184 185 /** 186 * @brief Defines the SMS message information. 187 */ 188 struct SmsMessageInfo { 189 /** 190 * Response type: 191 * 0: query and report 192 * 1: report 193 */ 194 int32_t indicationType = 0; 195 196 /** Total number. */ 197 int32_t size = 0; 198 199 /** Protocol data unit. */ 200 std::vector<uint8_t> pdu {}; 201 }; 202 203 /** 204 * @brief Defines the processing mode of received SMS messages. 205 */ 206 struct ModeData { 207 /** Request serial number. */ 208 int32_t serial = 0; 209 210 /** Whether to receive SMS messages */ 211 bool result = false; 212 213 /** 214 * Processing mode of received SMS messages. For details, see {@link 215 * AckIncomeCause}. 216 */ 217 int32_t mode = 0; 218 219 /** Protocol Data Unit. */ 220 std::string pdu = ""; 221 }; 222 223 /** 224 * @brief Defines an SMS message response. 225 */ 226 struct SendSmsResultInfo { 227 /** 228 * TP-Message-Reference for GSM, and BearerData MessageId for CDMA 229 * from 3GPP2 C.S0015-B, v2.0, 4.5-1 230 */ 231 int32_t msgRef = 0; 232 233 /** Protocol Data Unit */ 234 std::string pdu = ""; 235 236 /** Error code */ 237 int32_t errCode = 0; 238 239 /** SMS message response ID */ 240 int64_t flag = 0; 241 }; 242 243 struct CdmaSmsAddress { 244 int32_t digitMode = 0; 245 int32_t mode = 0; 246 int32_t type = 0; 247 int32_t plan = 0; 248 unsigned char number = 0; 249 unsigned char bytes[36] = { 0 }; 250 }; 251 252 struct CdmaSmsSubAddress { 253 int32_t type = 0; 254 unsigned char odd = 0; 255 unsigned char number = 0; 256 unsigned char bytes[36] = { 0 }; 257 }; 258 259 struct CdmaSmsMessageInfo { 260 int32_t serial = 0; 261 int32_t serviceId = 0; 262 unsigned char isExist = 0; 263 int32_t type = 0; 264 CdmaSmsAddress address; 265 CdmaSmsSubAddress subAddress; 266 int32_t size = 0; 267 unsigned char bytes[255] = { 0 }; 268 }; 269 270 struct CdmaSmsInfo { 271 /** 272 * Response type: 273 * 0: query and report 274 * 1: report 275 */ 276 int32_t indicationType = 0; 277 278 /** 279 * TP-Message-Reference for GSM, and BearerData MessageId for CDMA 280 * from 3GPP2 C.S0015-B, v2.0, 4.5-1 281 */ 282 int32_t msgRef = 0; 283 284 /** Protocol Data Unit. */ 285 std::string pdu = ""; 286 287 /** 288 * If unknown or not applicable, that is -1 from 3GPP 27.005, 3.2.5 for 289 * GSM/UMTS, 3GPP2 N.S0005 (IS-41C) Table 171 for CDMA 290 */ 291 int32_t errCode = 0; 292 }; 293 } // namespace Telephony 294 } // namespace OHOS 295 #endif // OHOS_TEL_RIL_SMS_PARCEL_H 296