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 SMS_CB_DATA_H 17 #define SMS_CB_DATA_H 18 19 #include <string> 20 21 #include "cdma_sms_types.h" 22 #include "sms_cb_message.h" 23 24 namespace OHOS { 25 namespace Telephony { 26 class SmsCbData { 27 public: 28 struct CbData { 29 int32_t slotId = -1; 30 std::string msgBody; 31 uint16_t serial = 0; 32 long recvTime = 0; 33 uint16_t msgId = 0; 34 int8_t format = 0; 35 uint16_t category = SMS_CMAE_CTG_RESERVED; 36 bool isEtws = false; 37 bool isCmas = false; 38 int8_t cmasClass = SMS_CMAE_ALERT_RESERVED; 39 int8_t cmasCate = SMS_CMAE_CTG_RESERVED; 40 int8_t severity = SMS_CMAE_SEVERITY_RESERVED; 41 int8_t urgency = SMS_CMAE_URGENCY_RESERVED; 42 int8_t certainty = SMS_CMAE_CERTAINTY_RESERVED; 43 uint16_t warnType = 0; 44 uint8_t msgType = SmsCbMessage::SMS_CBMSG_TYPE_UNKNOWN; 45 uint8_t langType = SmsCbMessage::SMS_CBMSG_LANG_DUMMY; 46 uint8_t dcs = 0; 47 int8_t priority = SMS_PRIORITY_NORMAL; 48 bool isPrimary = false; 49 int8_t cmasRes = SMS_CMAE_RESP_TYPE_RESERVED; 50 uint8_t geoScope = 0; 51 }; 52 inline static const std::string SLOT_ID = "slotId"; 53 inline static const std::string CB_MSG_TYPE = "cbMsgType"; 54 inline static const std::string LANG_TYPE = "langType"; 55 inline static const std::string DCS = "dcs"; 56 inline static const std::string PRIORITY = "priority"; 57 inline static const std::string CMAS_CLASS = "cmasClass"; 58 inline static const std::string CMAS_CATEGORY = "cmasCategory"; 59 inline static const std::string CMAS_RESPONSE = "cmasResponseType"; 60 inline static const std::string SEVERITY = "severity"; 61 inline static const std::string URGENCY = "urgency"; 62 inline static const std::string CERTAINTY = "certainty"; 63 inline static const std::string MSG_BODY = "msgBody"; 64 inline static const std::string FORMAT = "format"; 65 inline static const std::string SERIAL_NUM = "serialNum"; 66 inline static const std::string RECV_TIME = "recvTime"; 67 inline static const std::string MSG_ID = "msgId"; 68 inline static const std::string SERVICE_CATEGORY = "serviceCategory"; 69 inline static const std::string IS_ETWS_PRIMARY = "isEtwsPrimary"; 70 inline static const std::string IS_CMAS_MESSAGE = "isCmasMessage"; 71 inline static const std::string IS_ETWS_MESSAGE = "isEtwsMessage"; 72 inline static const std::string PLMN = "plmn"; 73 inline static const std::string LAC = "lac"; 74 inline static const std::string CID = "cid"; 75 inline static const std::string WARNING_TYPE = "warningType"; 76 inline static const std::string GEO_SCOPE = "geoScope"; 77 }; 78 } // namespace Telephony 79 } // namespace OHOS 80 #endif // SMS_CB_DATA_H 81 82