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 #ifndef OHOS_WIFI_DEVICE_CALLBACK_STUB_LITE_H 16 #define OHOS_WIFI_DEVICE_CALLBACK_STUB_LITE_H 17 18 #include "serializer.h" 19 #include "i_wifi_device_callback.h" 20 21 namespace OHOS { 22 namespace Wifi { 23 class WifiDeviceCallBackStub : public IWifiDeviceCallBack { 24 public: 25 WifiDeviceCallBackStub(); 26 virtual ~WifiDeviceCallBackStub(); 27 28 int OnRemoteRequest(uint32_t code, IpcIo *data); 29 30 void OnWifiStateChanged(int state) override; 31 void OnWifiConnectionChanged(int state, const WifiLinkedInfo &info) override; 32 void OnWifiRssiChanged(int rssi) override; 33 void OnWifiWpsStateChanged(int state, const std::string &pinCode) override; 34 void OnStreamChanged(int direction) override; 35 void OnDeviceConfigChanged(ConfigChange state) override; 36 void RegisterUserCallBack(const std::shared_ptr<IWifiDeviceCallBack> &callBack); 37 bool IsRemoteDied() const; 38 void SetRemoteDied(bool val); 39 40 private: 41 int OnRemoteInterfaceToken(uint32_t code, IpcIo *data); 42 int RemoteOnWifiStateChanged(uint32_t code, IpcIo *data); 43 int RemoteOnWifiConnectionChanged(uint32_t code, IpcIo *data); 44 int RemoteOnWifiRssiChanged(uint32_t code, IpcIo *data); 45 int RemoteOnWifiWpsStateChanged(uint32_t code, IpcIo *data); 46 int RemoteOnStreamChanged(uint32_t code, IpcIo *data); 47 int RemoteOnDeviceConfigChanged(uint32_t code, IpcIo *data); 48 49 std::shared_ptr<IWifiDeviceCallBack> callback_; 50 51 bool mRemoteDied; 52 }; 53 } // namespace Wifi 54 } // namespace OHOS 55 #endif 56