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_DHCP_CLIENT_CALLBACK_PROXY_H 16 #define OHOS_DHCP_CLIENT_CALLBACK_PROXY_H 17 18 #include "i_dhcp_client_callback.h" 19 #ifdef OHOS_ARCH_LITE 20 #ifndef OHOS_EUPDATER 21 #include "serializer.h" 22 #endif 23 #else 24 #include "iremote_proxy.h" 25 #endif 26 #include "dhcp_define.h" 27 28 namespace OHOS { 29 namespace Wifi { 30 31 #ifdef OHOS_ARCH_LITE 32 class DhcpClientCallbackProxy : public IDhcpClientCallBack { 33 public: 34 #ifndef OHOS_EUPDATER 35 explicit DhcpClientCallbackProxy(SvcIdentity *sid); 36 #endif 37 virtual ~DhcpClientCallbackProxy(); 38 #else 39 class DhcpClientCallbackProxy : public IRemoteProxy<IDhcpClientCallBack> { 40 public: 41 explicit DhcpClientCallbackProxy(const sptr<IRemoteObject> &impl); 42 virtual ~DhcpClientCallbackProxy(); 43 #endif 44 45 void OnIpSuccessChanged(int status, const std::string& ifname, DhcpResult& result) override; 46 void OnIpFailChanged(int status, const std::string& ifname, const std::string& reason) override; 47 private: 48 #ifdef OHOS_ARCH_LITE 49 #ifndef OHOS_EUPDATER 50 SvcIdentity sid_; 51 #endif 52 static const int DEFAULT_IPC_SIZE = 256; 53 #else 54 static inline BrokerDelegator<DhcpClientCallbackProxy> g_delegator; 55 #endif 56 }; 57 } // namespace Wifi 58 } // namespace OHOS 59 #endif 60