• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021-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 #include "wifi_hotspot_proxy.h"
16 #include "string_ex.h"
17 #include "iservice_registry.h"
18 #include "system_ability_definition.h"
19 #include "wifi_logger.h"
20 #include "wifi_hotspot_callback_stub.h"
21 
22 DEFINE_WIFILOG_HOTSPOT_LABEL("WifiHotspotProxy");
23 namespace OHOS {
24 namespace Wifi {
25 static sptr<WifiHotspotCallbackStub> g_wifiHotspotCallbackStub =
26     sptr<WifiHotspotCallbackStub>(new (std::nothrow) WifiHotspotCallbackStub());
27 
WifiHotspotProxy(const sptr<IRemoteObject> & impl)28 WifiHotspotProxy::WifiHotspotProxy(const sptr<IRemoteObject> &impl)
29     : IRemoteProxy<IWifiHotspot>(impl), mRemoteDied(false)
30 {
31     if (impl) {
32         if ((impl->IsProxyObject()) && (!impl->AddDeathRecipient(this))) {
33             WIFI_LOGD("AddDeathRecipient!");
34         } else {
35             WIFI_LOGW("no recipient!");
36         }
37     }
38 }
39 
~WifiHotspotProxy()40 WifiHotspotProxy::~WifiHotspotProxy()
41 {}
42 
IsHotspotActive(bool & bActive)43 ErrCode WifiHotspotProxy::IsHotspotActive(bool &bActive)
44 {
45     if (mRemoteDied) {
46         WIFI_LOGD("failed to `%{public}s`,remote service is died!", __func__);
47         return WIFI_OPT_FAILED;
48     }
49     MessageOption option;
50     MessageParcel data;
51     MessageParcel reply;
52     if (!data.WriteInterfaceToken(GetDescriptor())) {
53         WIFI_LOGE("Write interface token error: %{public}s", __func__);
54         return WIFI_OPT_FAILED;
55     }
56     data.WriteInt32(0);
57     int error = Remote()->SendRequest(WIFI_SVR_CMD_IS_HOTSPOT_ACTIVE, data, reply, option);
58     if (error != ERR_NONE) {
59         WIFI_LOGE("Set Attr(%{public}d) failed", WIFI_SVR_CMD_IS_HOTSPOT_ACTIVE);
60         return WIFI_OPT_FAILED;
61     }
62     int exception = reply.ReadInt32();
63     if (exception) {
64         return WIFI_OPT_FAILED;
65     }
66     int ret = reply.ReadInt32();
67     if (ErrCode(ret) != WIFI_OPT_SUCCESS) {
68         return ErrCode(ret);
69     }
70     bActive = ((reply.ReadInt32() == 1) ? true : false);
71     return WIFI_OPT_SUCCESS;
72 }
73 
GetHotspotState(int & state)74 ErrCode WifiHotspotProxy::GetHotspotState(int &state)
75 {
76     if (mRemoteDied) {
77         WIFI_LOGD("failed to `%{public}s`,remote service is died!", __func__);
78         return WIFI_OPT_FAILED;
79     }
80     MessageOption option;
81     MessageParcel data;
82     MessageParcel reply;
83     if (!data.WriteInterfaceToken(GetDescriptor())) {
84         WIFI_LOGE("Write interface token error: %{public}s", __func__);
85         return WIFI_OPT_FAILED;
86     }
87     data.WriteInt32(0);
88     int error = Remote()->SendRequest(WIFI_SVR_CMD_GETAPSTATE_WIFI, data, reply, option);
89     if (error != ERR_NONE) {
90         WIFI_LOGE("Set Attr(%{public}d) failed", WIFI_SVR_CMD_GETAPSTATE_WIFI);
91         return WIFI_OPT_FAILED;
92     }
93 
94     int exception = reply.ReadInt32();
95     if (exception) {
96         return WIFI_OPT_FAILED;
97     }
98     int ret = reply.ReadInt32();
99     if (ErrCode(ret) != WIFI_OPT_SUCCESS) {
100         return ErrCode(ret);
101     }
102     state = reply.ReadInt32();
103     return WIFI_OPT_SUCCESS;
104 }
105 
GetHotspotConfig(HotspotConfig & result)106 ErrCode WifiHotspotProxy::GetHotspotConfig(HotspotConfig &result)
107 {
108     if (mRemoteDied) {
109         WIFI_LOGD("failed to `%{public}s`,remote service is died!", __func__);
110         return WIFI_OPT_FAILED;
111     }
112     const char *readStr = nullptr;
113     MessageOption option;
114     MessageParcel data;
115     MessageParcel reply;
116     if (!data.WriteInterfaceToken(GetDescriptor())) {
117         WIFI_LOGE("Write interface token error: %{public}s", __func__);
118         return WIFI_OPT_FAILED;
119     }
120     data.WriteInt32(0);
121     int error = Remote()->SendRequest(WIFI_SVR_CMD_GET_HOTSPOT_CONFIG, data, reply, option);
122     if (error != ERR_NONE) {
123         WIFI_LOGE("Set Attr(%{public}d) failed", WIFI_SVR_CMD_GET_HOTSPOT_CONFIG);
124         return WIFI_OPT_FAILED;
125     }
126 
127     int exception = reply.ReadInt32();
128     if (exception) {
129         return WIFI_OPT_FAILED;
130     }
131     int ret = reply.ReadInt32();
132     if (ErrCode(ret) != WIFI_OPT_SUCCESS) {
133         return ErrCode(ret);
134     }
135 
136     readStr = reply.ReadCString();
137     result.SetSsid((readStr != nullptr) ? readStr : "");
138     result.SetSecurityType(static_cast<KeyMgmt>(reply.ReadInt32()));
139     result.SetBand(static_cast<BandType>(reply.ReadInt32()));
140     result.SetChannel(reply.ReadInt32());
141     readStr = reply.ReadCString();
142     result.SetPreSharedKey((readStr != nullptr) ? readStr : "");
143     result.SetMaxConn(reply.ReadInt32());
144 
145     return WIFI_OPT_SUCCESS;
146 }
147 
SetHotspotConfig(const HotspotConfig & config)148 ErrCode WifiHotspotProxy::SetHotspotConfig(const HotspotConfig &config)
149 {
150     if (mRemoteDied) {
151         WIFI_LOGD("failed to `%{public}s`,remote service is died!", __func__);
152         return WIFI_OPT_FAILED;
153     }
154     MessageOption option;
155     MessageParcel data;
156     MessageParcel reply;
157     if (!data.WriteInterfaceToken(GetDescriptor())) {
158         WIFI_LOGE("Write interface token error: %{public}s", __func__);
159         return WIFI_OPT_FAILED;
160     }
161     data.WriteInt32(0);
162     data.WriteCString(config.GetSsid().c_str());
163     data.WriteInt32(static_cast<int>(config.GetSecurityType()));
164     data.WriteInt32(static_cast<int>(config.GetBand()));
165     data.WriteInt32(config.GetChannel());
166     data.WriteCString(config.GetPreSharedKey().c_str());
167     data.WriteInt32(config.GetMaxConn());
168     int error = Remote()->SendRequest(WIFI_SVR_CMD_SETAPCONFIG_WIFI, data, reply, option);
169     if (error != ERR_NONE) {
170         WIFI_LOGE("Set Attr(%{public}d) failed", WIFI_SVR_CMD_SETAPCONFIG_WIFI);
171         return WIFI_OPT_FAILED;
172     }
173 
174     int exception = reply.ReadInt32();
175     if (exception) {
176         return WIFI_OPT_FAILED;
177     }
178     return ErrCode(reply.ReadInt32());
179 }
180 
GetStationList(std::vector<StationInfo> & result)181 ErrCode WifiHotspotProxy::GetStationList(std::vector<StationInfo> &result)
182 {
183     if (mRemoteDied) {
184         WIFI_LOGD("failed to `%{public}s`,remote service is died!", __func__);
185         return WIFI_OPT_FAILED;
186     }
187     const char *readStr = nullptr;
188     MessageOption option;
189     MessageParcel data;
190     MessageParcel reply;
191     if (!data.WriteInterfaceToken(GetDescriptor())) {
192         WIFI_LOGE("Write interface token error: %{public}s", __func__);
193         return WIFI_OPT_FAILED;
194     }
195     data.WriteInt32(0);
196     int error = Remote()->SendRequest(WIFI_SVR_CMD_GET_STATION_LIST, data, reply, option);
197     if (error != ERR_NONE) {
198         WIFI_LOGE("Set Attr(%{public}d) failed", WIFI_SVR_CMD_GET_STATION_LIST);
199         return WIFI_OPT_FAILED;
200     }
201 
202     int exception = reply.ReadInt32();
203     if (exception) {
204         return WIFI_OPT_FAILED;
205     }
206     int ret = reply.ReadInt32();
207     if (ErrCode(ret) != WIFI_OPT_SUCCESS) {
208         return ErrCode(ret);
209     }
210     constexpr int MAX_SIZE = 512;
211     int size = reply.ReadInt32();
212     if (size > MAX_SIZE) {
213         WIFI_LOGE("Station list size error: %{public}d", size);
214         return WIFI_OPT_FAILED;
215     }
216     for (int i = 0; i < size; i++) {
217         StationInfo info;
218         readStr = reply.ReadCString();
219         info.deviceName = (readStr != nullptr) ? readStr : "";
220         readStr = reply.ReadCString();
221         info.bssid = (readStr != nullptr) ? readStr : "";
222         readStr = reply.ReadCString();
223         info.ipAddr = (readStr != nullptr) ? readStr : "";
224         result.emplace_back(info);
225     }
226 
227     return WIFI_OPT_SUCCESS;
228 }
229 
DisassociateSta(const StationInfo & info)230 ErrCode WifiHotspotProxy::DisassociateSta(const StationInfo &info)
231 {
232     if (mRemoteDied) {
233         WIFI_LOGD("failed to `%{public}s`,remote service is died!", __func__);
234         return WIFI_OPT_FAILED;
235     }
236     MessageOption option;
237     MessageParcel data;
238     MessageParcel reply;
239     if (!data.WriteInterfaceToken(GetDescriptor())) {
240         WIFI_LOGE("Write interface token error: %{public}s", __func__);
241         return WIFI_OPT_FAILED;
242     }
243     data.WriteInt32(0);
244     data.WriteCString(info.deviceName.c_str());
245     data.WriteCString(info.bssid.c_str());
246     data.WriteCString(info.ipAddr.c_str());
247     int error = Remote()->SendRequest(WIFI_SVR_CMD_DISCONNECT_STA, data, reply, option);
248     if (error != ERR_NONE) {
249         WIFI_LOGE("Set Attr(%{public}d) failed", WIFI_SVR_CMD_DISCONNECT_STA);
250         return WIFI_OPT_FAILED;
251     }
252 
253     int exception = reply.ReadInt32();
254     if (exception) {
255         return ErrCode(exception);
256     }
257     return ErrCode(reply.ReadInt32());
258 }
259 
EnableHotspot(void)260 ErrCode WifiHotspotProxy::EnableHotspot(void)
261 {
262     MessageOption option;
263     MessageParcel data;
264     MessageParcel reply;
265     if (!data.WriteInterfaceToken(GetDescriptor())) {
266         WIFI_LOGE("Write interface token error: %{public}s", __func__);
267         return WIFI_OPT_FAILED;
268     }
269     data.WriteInt32(0);
270     int error = Remote()->SendRequest(WIFI_SVR_CMD_ENABLE_WIFI_AP, data, reply, option);
271     if (error != ERR_NONE) {
272         WIFI_LOGE("Set Attr(%{public}d) failed", WIFI_SVR_CMD_ENABLE_WIFI_AP);
273         return WIFI_OPT_FAILED;
274     }
275 
276     int exception = reply.ReadInt32();
277     if (exception) {
278         return WIFI_OPT_FAILED;
279     }
280     return ErrCode(reply.ReadInt32());
281 }
282 
DisableHotspot(void)283 ErrCode WifiHotspotProxy::DisableHotspot(void)
284 {
285     if (mRemoteDied) {
286         WIFI_LOGD("failed to `%{public}s`,remote service is died!", __func__);
287         return WIFI_OPT_FAILED;
288     }
289     MessageOption option;
290     MessageParcel data;
291     MessageParcel reply;
292     if (!data.WriteInterfaceToken(GetDescriptor())) {
293         WIFI_LOGE("Write interface token error: %{public}s", __func__);
294         return WIFI_OPT_FAILED;
295     }
296     data.WriteInt32(0);
297     int error = Remote()->SendRequest(WIFI_SVR_CMD_DISABLE_WIFI_AP, data, reply, option);
298     if (error != ERR_NONE) {
299         WIFI_LOGE("Set Attr(%{public}d) failed", WIFI_SVR_CMD_DISABLE_WIFI_AP);
300         return WIFI_OPT_FAILED;
301     }
302 
303     int exception = reply.ReadInt32();
304     if (exception) {
305         return WIFI_OPT_FAILED;
306     }
307     return ErrCode(reply.ReadInt32());
308 }
309 
GetBlockLists(std::vector<StationInfo> & infos)310 ErrCode WifiHotspotProxy::GetBlockLists(std::vector<StationInfo> &infos)
311 {
312     if (mRemoteDied) {
313         WIFI_LOGD("failed to `%{public}s`,remote service is died!", __func__);
314         return WIFI_OPT_FAILED;
315     }
316     const char *readStr = nullptr;
317     MessageOption option;
318     MessageParcel data;
319     MessageParcel reply;
320     if (!data.WriteInterfaceToken(GetDescriptor())) {
321         WIFI_LOGE("Write interface token error: %{public}s", __func__);
322         return WIFI_OPT_FAILED;
323     }
324     data.WriteInt32(0);
325     int error = Remote()->SendRequest(WIFI_SVR_CMD_GET_BLOCK_LISTS, data, reply, option);
326     if (error != ERR_NONE) {
327         WIFI_LOGE("Set Attr(%{public}d) failed", WIFI_SVR_CMD_GET_BLOCK_LISTS);
328         return WIFI_OPT_FAILED;
329     }
330 
331     int exception = reply.ReadInt32();
332     if (exception) {
333         return WIFI_OPT_FAILED;
334     }
335     int err = reply.ReadInt32();
336     if (err != WIFI_OPT_SUCCESS) {
337         return ErrCode(err);
338     }
339 
340     constexpr int MAX_SIZE = 512;
341     int size = reply.ReadInt32();
342     if (size > MAX_SIZE) {
343         WIFI_LOGE("Get block size error: %{public}d", size);
344         return WIFI_OPT_FAILED;
345     }
346 
347     for (int i = 0; i < size; i++) {
348         StationInfo info;
349         readStr = reply.ReadCString();
350         info.deviceName = (readStr != nullptr) ? readStr : "";
351         readStr = reply.ReadCString();
352         info.bssid = (readStr != nullptr) ? readStr : "";
353         readStr = reply.ReadCString();
354         info.ipAddr = (readStr != nullptr) ? readStr : "";
355         infos.push_back(info);
356     }
357     return WIFI_OPT_SUCCESS;
358 }
359 
AddBlockList(const StationInfo & info)360 ErrCode WifiHotspotProxy::AddBlockList(const StationInfo &info)
361 {
362     if (mRemoteDied) {
363         WIFI_LOGD("failed to `%{public}s`,remote service is died!", __func__);
364         return WIFI_OPT_FAILED;
365     }
366     MessageOption option;
367     MessageParcel data;
368     MessageParcel reply;
369     if (!data.WriteInterfaceToken(GetDescriptor())) {
370         WIFI_LOGE("Write interface token error: %{public}s", __func__);
371         return WIFI_OPT_FAILED;
372     }
373     data.WriteInt32(0);
374     data.WriteCString(info.deviceName.c_str());
375     data.WriteCString(info.bssid.c_str());
376     data.WriteCString(info.ipAddr.c_str());
377     int error = Remote()->SendRequest(WIFI_SVR_CMD_ADD_BLOCK_LIST, data, reply, option);
378     if (error != ERR_NONE) {
379         WIFI_LOGE("Set Attr(%{public}d) failed", WIFI_SVR_CMD_ADD_BLOCK_LIST);
380         return WIFI_OPT_FAILED;
381     }
382 
383     int exception = reply.ReadInt32();
384     if (exception) {
385         return WIFI_OPT_FAILED;
386     }
387     return ErrCode(reply.ReadInt32());
388 }
389 
DelBlockList(const StationInfo & info)390 ErrCode WifiHotspotProxy::DelBlockList(const StationInfo &info)
391 {
392     if (mRemoteDied) {
393         WIFI_LOGD("failed to `%{public}s`,remote service is died!", __func__);
394         return WIFI_OPT_FAILED;
395     }
396     MessageOption option;
397     MessageParcel data;
398     MessageParcel reply;
399     if (!data.WriteInterfaceToken(GetDescriptor())) {
400         WIFI_LOGE("Write interface token error: %{public}s", __func__);
401         return WIFI_OPT_FAILED;
402     }
403     data.WriteInt32(0);
404     data.WriteCString(info.deviceName.c_str());
405     data.WriteCString(info.bssid.c_str());
406     data.WriteCString(info.ipAddr.c_str());
407     int error = Remote()->SendRequest(WIFI_SVR_CMD_DEL_BLOCK_LIST, data, reply, option);
408     if (error != ERR_NONE) {
409         WIFI_LOGE("Set Attr(%{public}d) failed", WIFI_SVR_CMD_DEL_BLOCK_LIST);
410         return WIFI_OPT_FAILED;
411     }
412 
413     int exception = reply.ReadInt32();
414     if (exception) {
415         return WIFI_OPT_FAILED;
416     }
417     return ErrCode(reply.ReadInt32());
418 }
419 
GetValidBands(std::vector<BandType> & bands)420 ErrCode WifiHotspotProxy::GetValidBands(std::vector<BandType> &bands)
421 {
422     if (mRemoteDied) {
423         WIFI_LOGD("failed to `%{public}s`,remote service is died!", __func__);
424         return WIFI_OPT_FAILED;
425     }
426     MessageOption option;
427     MessageParcel data;
428     MessageParcel reply;
429     if (!data.WriteInterfaceToken(GetDescriptor())) {
430         WIFI_LOGE("Write interface token error: %{public}s", __func__);
431         return WIFI_OPT_FAILED;
432     }
433     data.WriteInt32(0);
434     int error = Remote()->SendRequest(WIFI_SVR_CMD_GET_VALID_BANDS, data, reply, option);
435     if (error != ERR_NONE) {
436         WIFI_LOGE("Set Attr(%{public}d) failed", WIFI_SVR_CMD_GET_VALID_BANDS);
437         return WIFI_OPT_FAILED;
438     }
439 
440     int exception = reply.ReadInt32();
441     if (exception) {
442         return WIFI_OPT_FAILED;
443     }
444     int err = reply.ReadInt32();
445     if (err != WIFI_OPT_SUCCESS) {
446         return ErrCode(err);
447     }
448 
449     constexpr int MAX_BAND_SIZE = 512;
450     int count = reply.ReadInt32();
451     if (count > MAX_BAND_SIZE) {
452         WIFI_LOGE("Band size error: %{public}d", count);
453         return WIFI_OPT_FAILED;
454     }
455     for (int i = 0; i < count; i++) {
456         int val = reply.ReadInt32();
457         bands.push_back(BandType(val));
458     }
459     return WIFI_OPT_SUCCESS;
460 }
461 
GetValidChannels(BandType band,std::vector<int32_t> & validchannels)462 ErrCode WifiHotspotProxy::GetValidChannels(BandType band, std::vector<int32_t> &validchannels)
463 {
464     if (mRemoteDied) {
465         WIFI_LOGD("failed to `%{public}s`,remote service is died!", __func__);
466         return WIFI_OPT_FAILED;
467     }
468     MessageOption option;
469     MessageParcel data;
470     MessageParcel reply;
471     if (!data.WriteInterfaceToken(GetDescriptor())) {
472         WIFI_LOGE("Write interface token error: %{public}s", __func__);
473         return WIFI_OPT_FAILED;
474     }
475     data.WriteInt32(0);
476     data.WriteInt32((int)band);
477     int error = Remote()->SendRequest(WIFI_SVR_CMD_GET_VALID_CHANNELS, data, reply, option);
478     if (error != ERR_NONE) {
479         WIFI_LOGE("Set Attr(%{public}d) failed", WIFI_SVR_CMD_GET_VALID_CHANNELS);
480         return WIFI_OPT_FAILED;
481     }
482 
483     int exception = reply.ReadInt32();
484     if (exception) {
485         return WIFI_OPT_FAILED;
486     }
487     int err = reply.ReadInt32();
488     if (err != WIFI_OPT_SUCCESS) {
489         return ErrCode(err);
490     }
491 
492     constexpr int MAX_CHANNELS_SIZE = 512;
493     int count = reply.ReadInt32();
494     if (count > MAX_CHANNELS_SIZE) {
495         WIFI_LOGE("Channel size error: %{public}d", count);
496         return WIFI_OPT_FAILED;
497     }
498     for (int i = 0; i < count; i++) {
499         int val = reply.ReadInt32();
500         validchannels.push_back(val);
501     }
502     return WIFI_OPT_SUCCESS;
503 }
504 
RegisterCallBack(const sptr<IWifiHotspotCallback> & callback)505 ErrCode WifiHotspotProxy::RegisterCallBack(const sptr<IWifiHotspotCallback> &callback)
506 {
507     WIFI_LOGD("WifiHotspotProxy::RegisterCallBack!");
508     MessageParcel data;
509     MessageParcel reply;
510     MessageOption option(MessageOption::TF_ASYNC);
511 
512     g_wifiHotspotCallbackStub->RegisterCallBack(callback);
513     if (!data.WriteInterfaceToken(GetDescriptor())) {
514         WIFI_LOGE("Write interface token error: %{public}s", __func__);
515         return WIFI_OPT_FAILED;
516     }
517     data.WriteInt32(0);
518     if (!data.WriteRemoteObject(g_wifiHotspotCallbackStub->AsObject())) {
519         WIFI_LOGE("WifiHotspotProxy::RegisterCallBack WriteDate fail, write callback.");
520         return WIFI_OPT_FAILED;
521     }
522 
523     int error = Remote()->SendRequest(WIFI_SVR_CMD_REGISTER_HOTSPOT_CALLBACK, data, reply, option);
524     if (error != ERR_NONE) {
525         WIFI_LOGE("WifiHotspotProxy::RegisterCallBack failed, error code is %{public}d ", error);
526         return WIFI_OPT_FAILED;
527     }
528     int exception = reply.ReadInt32();
529     if (exception) {
530         return WIFI_OPT_FAILED;
531     }
532     int ret = reply.ReadInt32();
533     return ErrCode(ret);
534 }
535 
GetSupportedFeatures(long & features)536 ErrCode WifiHotspotProxy::GetSupportedFeatures(long &features)
537 {
538     if (mRemoteDied) {
539         WIFI_LOGD("failed to `%{public}s`,remote service is died!", __func__);
540         return WIFI_OPT_FAILED;
541     }
542     MessageOption option;
543     MessageParcel data, reply;
544     if (!data.WriteInterfaceToken(GetDescriptor())) {
545         WIFI_LOGE("Write interface token error: %{public}s", __func__);
546         return WIFI_OPT_FAILED;
547     }
548     data.WriteInt32(0);
549     int error = Remote()->SendRequest(WIFI_SVR_CMD_GET_SUPPORTED_FEATURES, data, reply, option);
550     if (error != ERR_NONE) {
551         WIFI_LOGE("Set Attr(%{public}d) failed,error code is %{public}d", WIFI_SVR_CMD_GET_SUPPORTED_FEATURES, error);
552         return ErrCode(error);
553     }
554     int exception = reply.ReadInt32();
555     if (exception) {
556         return WIFI_OPT_FAILED;
557     }
558     int ret = reply.ReadInt32();
559     if (ret != WIFI_OPT_SUCCESS) {
560         return ErrCode(ret);
561     }
562 
563     features = reply.ReadInt64();
564     return WIFI_OPT_SUCCESS;
565 }
566 
OnRemoteDied(const wptr<IRemoteObject> & remoteObject)567 void WifiHotspotProxy::OnRemoteDied(const wptr<IRemoteObject>& remoteObject)
568 {
569     WIFI_LOGD("Remote service is died!");
570     mRemoteDied = true;
571     if (g_wifiHotspotCallbackStub != nullptr) {
572         g_wifiHotspotCallbackStub->SetRemoteDied(true);
573     }
574 }
575 }  // namespace Wifi
576 }  // namespace OHOS