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_SCAN_CALLBACK_STUB_H 16 #define OHOS_I_WIFI_SCAN_CALLBACK_STUB_H 17 18 #include "iremote_stub.h" 19 #include "i_wifi_scan_callback.h" 20 21 namespace OHOS { 22 namespace Wifi { 23 class WifiScanCallbackStub : public IRemoteStub<IWifiScanCallback> { 24 public: 25 WifiScanCallbackStub(); 26 virtual ~WifiScanCallbackStub(); 27 28 virtual int OnRemoteRequest( 29 uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; 30 void OnWifiScanStateChanged(int state) override; 31 void RegisterCallBack(const sptr<IWifiScanCallback> &userCallback); 32 bool IsRemoteDied() const; 33 void SetRemoteDied(bool val); 34 35 private: 36 int RemoteOnWifiScanStateChanged(uint32_t code, MessageParcel &data, MessageParcel &reply); 37 sptr<IWifiScanCallback> userCallback_; 38 39 bool mRemoteDied; 40 }; 41 } // namespace Wifi 42 } // namespace OHOS 43 #endif