• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021-2023 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_common.h"
22 #include "gsm_cb_codec.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         int64_t recvTime = 0;
33         uint16_t msgId = 0;
34         int8_t format = 0;
35         uint16_t category = static_cast<uint16_t>(SmsCmaeCategory::RESERVED);
36         bool isEtws = false;
37         bool isCmas = false;
38         uint8_t cmasClass = static_cast<uint8_t>(SmsCmaeAlertHandle::RESERVED);
39         uint8_t cmasCate = static_cast<uint8_t>(SmsCmaeCategory::RESERVED);
40         uint8_t severity = static_cast<uint8_t>(SmsCmaeSeverity::RESERVED);
41         uint8_t urgency = static_cast<uint8_t>(SmsCmaeUrgency::IMMEDIATE);
42         uint8_t certainty = static_cast<uint8_t>(SmsCmaeCertainty::RESERVED);
43         uint16_t warnType = 0;
44         uint8_t msgType = GsmCbCodec::GSM_UNKNOWN;
45         uint8_t langType = GsmCbCodec::CB_LANG_DUMMY;
46         uint8_t dcs = 0;
47         int8_t priority = static_cast<int8_t>(SmsPriorityIndicator::NORMAL);
48         bool isPrimary = false;
49         uint8_t cmasRes = static_cast<uint8_t>(SmsCmaeResponseType::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