1 /*
2  * Copyright (C) 2022 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 CORE_SERVICE_HISYSEVENT_H
17 #define CORE_SERVICE_HISYSEVENT_H
18 
19 #include <string>
20 
21 #include "telephony_hisysevent.h"
22 
23 namespace OHOS {
24 namespace Telephony {
25 static const int32_t SWITCH_ON = 1;
26 static const int32_t SWITCH_OFF = 0;
27 
28 enum class SmsMmsMessageType {
29     SMS_SHORT_MESSAGE,
30     MMS_SHORT_MESSAGE,
31     CELL_BROAD_CAST,
32     WAP_PUSH,
33 };
34 
35 class CoreServiceHiSysEvent : public TelephonyHiSysEvent {
36 public:
37     static void WriteSignalLevelBehaviorEvent(int32_t slotId, int32_t level);
38     static void WriteNetworkStateBehaviorEvent(int32_t slotId, int32_t domain, int32_t tech, int32_t state);
39     static void WriteDefaultDataSlotIdBehaviorEvent(int32_t slotId);
40     static void WriteSimStateBehaviorEvent(int32_t slotId, int32_t state);
41     static void WriteDialCallFaultEvent(int32_t slotId, int32_t errCode, const std::string &desc);
42     static void WriteAnswerCallFaultEvent(int32_t slotId, int32_t errCode, const std::string &desc);
43     static void WriteHangUpFaultEvent(int32_t slotId, int32_t errCode, const std::string &desc);
44     static void WriteSmsSendFaultEvent(
45         int32_t slotId, SmsMmsMessageType type, SmsMmsErrorCode errorCode, const std::string &desc);
46     static void WriteSmsReceiveFaultEvent(
47         int32_t slotId, SmsMmsMessageType type, SmsMmsErrorCode errorCode, const std::string &desc);
48     static void WriteDataActivateFaultEvent(
49         int32_t slotId, int32_t switchState, CellularDataErrorCode errorType, const std::string &errorMsg);
50     static void WriteAirplaneModeChangeEvent(const int32_t enable);
51     static void WriteSetActiveSimFaultEvent(int32_t slotId, SimCardErrorCode errorCode, const std::string &desc);
52 };
53 } // namespace Telephony
54 } // namespace OHOS
55 #endif // CORE_SERVICE_HISYSEVENT_H
56