• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 OHOS_WIFI_HISYSEVENT_H
17 #define OHOS_WIFI_HISYSEVENT_H
18 
19 #include <string>
20 
21 namespace OHOS {
22 namespace Wifi {
23 enum class WifiOperType {
24     ENABLE,
25     DISABLE
26 };
27 
28 enum class WifiConnectionType {
29     CONNECT,
30     DISCONNECT
31 };
32 
33 const int HISYS_EVENT_DEFAULT_VALUE = -1;
34 
35 const std::string HISYS_STA_POWER_STATE_CHANGE = "wifiStateChange";
36 const std::string HISYS_STA_CONN_STATE_CHANGE = "wifiConnectionChange";
37 const std::string HISYS_STA_SCAN_STATE_CHANGE = "wifiScanStateChange";
38 const std::string HISYS_STA_RSSI_STATE_CHANGE = "wifiRssiChange";
39 const std::string HISYS_HOTSPOT_STATE_CHANGE = "hotspotStateChange";
40 const std::string HISYS_HOTSPOT_STA_JOIN = "hotspotStaJoin";
41 const std::string HISYS_HOTSPOT_STA_LEAVE = "hotspotStaLeave";
42 const std::string HISYS_P2P_STATE_CHANGE = "p2pStateChange";
43 const std::string HISYS_P2P_CONN_STATE_CHANGE = "p2pConnectionChange";
44 const std::string HISYS_P2P_DEVICE_STATE_CHANGE = "p2pDeviceChange";
45 const std::string HISYS_P2P_PERSISTENT_GROUP_CHANGE = "p2pPersistentGroupChange";
46 const std::string HISYS_P2P_PEER_DEVICE_CHANGE = "p2pPeerDeviceChange";
47 const std::string HISYS_P2P_DISCOVERY_CHANGE = "p2pDiscoveryChange";
48 
49 const std::string HISYS_SERVICE_TYPE_STA = "STA";
50 const std::string HISYS_SERVICE_TYPE_AP = "AP";
51 const std::string HISYS_SERVICE_TYPE_P2P = "P2P";
52 
53 void WriteWifiStateHiSysEvent(const std::string& serviceType, WifiOperType operType);
54 
55 void WriteWifiConnectionHiSysEvent(const WifiConnectionType& type, const std::string& pkgName);
56 
57 void WriteWifiScanHiSysEvent(const int result, const std::string& pkgName);
58 
59 void WriteWifiEventReceivedHiSysEvent(const std::string& eventType, int value);
60 }  // namespace Wifi
61 }  // namespace OHOS
62 #endif