• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
16 #ifndef INTERFACES_INNERKITS_SOFTBUS_CLIENT_H_
17 #define INTERFACES_INNERKITS_SOFTBUS_CLIENT_H_
18 
19 #include "discovery_service.h"
20 #include "iremote_broker.h"
21 #include "iremote_object.h"
22 #include "iremote_proxy.h"
23 #include "session.h"
24 #include "softbus_def.h"
25 
26 namespace OHOS {
27 class ISoftBusClient : public IRemoteBroker {
28 public:
29     ~ISoftBusClient() override = default;
30 
31     virtual void OnDeviceFound(const DeviceInfo *device);
32 
33     virtual void OnDiscoverFailed(int subscribeId, int failReason);
34 
35     virtual void OnDiscoverySuccess(int subscribeId);
36 
37     virtual void OnPublishSuccess(int publishId);
38 
39     virtual void OnPublishFail(int publishId, int reason);
40 
41     virtual int32_t OnChannelOpened(const char *sessionName, const ChannelInfo *channel);
42 
43     virtual int32_t OnChannelOpenFailed(int32_t channelId, int32_t channelType, int32_t errCode);
44 
45     virtual int32_t OnChannelLinkDown(const char *networkId, int32_t routeType);
46 
47     virtual int32_t OnChannelMsgReceived(int32_t channelId, int32_t channelType, const void *data,
48                                          uint32_t len, int32_t type);
49 
50     virtual int32_t OnChannelClosed(int32_t channelId, int32_t channelType);
51 
52     virtual int32_t OnChannelQosEvent(int32_t channelId, int32_t channelType, int32_t eventId, int32_t tvCount,
53                                       const QosTv *tvList);
54 
55     virtual int32_t OnJoinLNNResult(void *addr, uint32_t addrTypeLen, const char *networkId, int retCode);
56 
57     virtual int32_t OnJoinMetaNodeResult(void *addr, uint32_t addrTypeLen, void *metaInfo, uint32_t infoLen,
58                                          int retCode);
59 
60     virtual int32_t OnLeaveLNNResult(const char *networkId, int retCode);
61 
62     virtual int32_t OnLeaveMetaNodeResult(const char *networkId, int retCode);
63 
64     virtual int32_t OnNodeOnlineStateChanged(const char *pkgName, bool isOnline, void *info, uint32_t infoTypeLen);
65 
66     virtual int32_t OnNodeBasicInfoChanged(const char *pkgName, void *info, uint32_t infoTypeLen, int32_t type);
67 
68     virtual int32_t OnTimeSyncResult(const void *info, uint32_t infoTypeLen, int32_t retCode);
69 
70     virtual void OnPublishLNNResult(int32_t publishId, int32_t reason);
71 
72     virtual void OnRefreshLNNResult(int32_t refreshId, int32_t reason);
73 
74     virtual void OnRefreshDeviceFound(const void *device, uint32_t deviceLen);
75 
76 public:
77     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.ISoftBusClient");
78 };
79 }
80 #endif