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 #ifndef OHOS_I_WIFI_DEVICE_CALLBACK_H
16 #define OHOS_I_WIFI_DEVICE_CALLBACK_H
17 
18 #include <string>
19 #ifndef OHOS_ARCH_LITE
20 #include <string_ex.h>
21 #include <iremote_stub.h>
22 #include "message_parcel.h"
23 #include "message_option.h"
24 #endif
25 #include "wifi_msg.h"
26 #include "define.h"
27 
28 
29 namespace OHOS {
30 namespace Wifi {
31 #ifdef OHOS_ARCH_LITE
32 class IWifiDeviceCallBack {
33 #else
34 class IWifiDeviceCallBack : public IRemoteBroker {
35 #endif
36 public:
37     /**
38      * @Description Deal wifi state change message
39      *
40      * @param state - Wifi State
41      */
42     virtual void OnWifiStateChanged(int state) = 0;
43 
44     /**
45      * @Description Deal wifi connection state change message
46      *
47      * @param state - Wifi connect state
48      * @param info - WifiLinkedInfo object
49      */
50     virtual void OnWifiConnectionChanged(int state, const WifiLinkedInfo &info) = 0;
51 
52     /**
53      * @Description Deal wifi rssi change message
54      *
55      * @param rssi - rssi
56      */
57     virtual void OnWifiRssiChanged(int rssi) = 0;
58 
59     /**
60      * @Description Deal wps state change message
61      *
62      * @param state - wps state
63      * @param pinCode - when wps pin mode, open wps successfully, return the pin code
64      */
65     virtual void OnWifiWpsStateChanged(int state, const std::string &pinCode) = 0;
66 
67     /**
68      * @Description Deal stream change message
69      *
70      * @param direction - stream direction
71      */
72     virtual void OnStreamChanged(int direction) = 0;
73 
74     /**
75      * @Description Deal device config change message
76      *
77      * @param ConfigChange - change type of config
78      */
79     virtual void OnDeviceConfigChanged(ConfigChange value) = 0;
80 
81 #ifndef OHOS_ARCH_LITE
82 public:
83     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.wifi.IWifiDeviceCallBack");
84 #endif
85 };
86 }  // namespace Wifi
87 }  // namespace OHOS
88 #endif