1 /* 2 * Copyright (c) 2021-2025 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 "data_level_inner.h" 20 #include "iremote_proxy.h" 21 #include "session.h" 22 #include "socket.h" 23 #include "softbus_def.h" 24 25 namespace OHOS { 26 class ISoftBusClient : public IRemoteBroker { 27 public: 28 ~ISoftBusClient() override = default; 29 30 virtual int32_t OnChannelOpened(const char *sessionName, const ChannelInfo *channel); 31 32 virtual int32_t OnChannelOpenFailed(int32_t channelId, int32_t channelType, int32_t errCode); 33 34 virtual int32_t OnChannelLinkDown(const char *networkId, int32_t routeType); 35 36 virtual int32_t OnChannelMsgReceived(int32_t channelId, int32_t channelType, const void *data, 37 uint32_t len, int32_t type); 38 39 virtual int32_t OnChannelClosed(int32_t channelId, int32_t channelType, int32_t messageType); 40 41 virtual int32_t OnChannelQosEvent(int32_t channelId, int32_t channelType, int32_t eventId, int32_t tvCount, 42 const QosTv *tvList); 43 virtual int32_t SetChannelInfo(const char *sessionName, int32_t sessionId, int32_t channelId, int32_t channelType); 44 45 virtual int32_t OnJoinLNNResult(void *addr, uint32_t addrTypeLen, const char *networkId, int retCode); 46 47 virtual int32_t OnJoinMetaNodeResult(void *addr, uint32_t addrTypeLen, void *metaInfo, uint32_t infoLen, 48 int retCode); 49 50 virtual int32_t OnLeaveLNNResult(const char *networkId, int retCode); 51 52 virtual int32_t OnLeaveMetaNodeResult(const char *networkId, int retCode); 53 54 virtual int32_t OnNodeOnlineStateChanged(const char *pkgName, bool isOnline, void *info, uint32_t infoTypeLen); 55 56 virtual int32_t OnNodeBasicInfoChanged(const char *pkgName, void *info, uint32_t infoTypeLen, int32_t type); 57 58 virtual int32_t OnNodeStatusChanged(const char *pkgName, void *info, uint32_t infoTypeLen, int32_t type); 59 60 virtual int32_t OnLocalNetworkIdChanged(const char *pkgName); 61 62 virtual int32_t OnNodeDeviceTrustedChange(const char *pkgName, int32_t type, const char *msg, uint32_t msgLen); 63 64 virtual int32_t OnHichainProofException( 65 const char *pkgName, const char *proofInfo, uint32_t proofLen, uint16_t deviceTypeId, int32_t errCode); 66 67 virtual int32_t OnTimeSyncResult(const void *info, uint32_t infoTypeLen, int32_t retCode); 68 69 virtual void OnPublishLNNResult(int32_t publishId, int32_t reason); 70 71 virtual void OnRefreshLNNResult(int32_t refreshId, int32_t reason); 72 73 virtual void OnRefreshDeviceFound(const void *device, uint32_t deviceLen); 74 75 virtual void OnDataLevelChanged(const char *networkId, const DataLevelInfo *dataLevelInfo); 76 77 virtual void OnMsdpRangeResult(const RangeResultInnerInfo *rangeInfo); 78 79 virtual int32_t OnClientTransLimitChange(int32_t channelId, uint8_t tos); 80 81 virtual int32_t OnChannelBind(int32_t channelId, int32_t channelType); 82 83 virtual int32_t OnClientChannelOnQos( 84 int32_t channelId, int32_t channelType, QoSEvent event, const QosTV *qos, uint32_t count); 85 86 virtual int32_t OnCheckCollabRelation(const CollabInfo *sourceInfo, bool isSinkSide, const CollabInfo *sinkInfo, 87 int32_t channelId, int32_t channelType); 88 89 virtual int32_t OnConnectionStateChange(uint32_t handle, int32_t state, int32_t reason); 90 91 virtual int32_t OnAcceptConnect(const char *name, uint32_t handle); 92 93 virtual int32_t OnDataReceived(uint32_t handle, const uint8_t *data, uint32_t len); 94 95 virtual int32_t OnBrProxyOpened(int32_t channelId, const char *brMac, const char *uuid, int32_t reason); 96 virtual int32_t OnBrProxyDataRecv(int32_t channelId, const uint8_t *data, uint32_t len); 97 virtual int32_t OnBrProxyStateChanged(int32_t channelId, int32_t channelState); 98 virtual int32_t OnBrProxyQueryPermission(const char *bundleName, bool *isEmpowered); 99 100 public: 101 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.ISoftBusClient"); 102 }; 103 } 104 #endif 105