1060ff233Sopenharmony_ci/* 2060ff233Sopenharmony_ci * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 3060ff233Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4060ff233Sopenharmony_ci * you may not use this file except in compliance with the License. 5060ff233Sopenharmony_ci * You may obtain a copy of the License at 6060ff233Sopenharmony_ci * 7060ff233Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8060ff233Sopenharmony_ci * 9060ff233Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10060ff233Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11060ff233Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12060ff233Sopenharmony_ci * See the License for the specific language governing permissions and 13060ff233Sopenharmony_ci * limitations under the License. 14060ff233Sopenharmony_ci */ 15060ff233Sopenharmony_ci 16060ff233Sopenharmony_ci#ifndef INTERFACES_INNERKITS_SOFTBUS_CLIENT_H_ 17060ff233Sopenharmony_ci#define INTERFACES_INNERKITS_SOFTBUS_CLIENT_H_ 18060ff233Sopenharmony_ci 19060ff233Sopenharmony_ci#include "data_level_inner.h" 20060ff233Sopenharmony_ci#include "iremote_broker.h" 21060ff233Sopenharmony_ci#include "iremote_object.h" 22060ff233Sopenharmony_ci#include "iremote_proxy.h" 23060ff233Sopenharmony_ci#include "session.h" 24060ff233Sopenharmony_ci#include "softbus_common.h" 25060ff233Sopenharmony_ci#include "softbus_def.h" 26060ff233Sopenharmony_ci 27060ff233Sopenharmony_cinamespace OHOS { 28060ff233Sopenharmony_ciclass ISoftBusClient : public IRemoteBroker { 29060ff233Sopenharmony_cipublic: 30060ff233Sopenharmony_ci ~ISoftBusClient() override = default; 31060ff233Sopenharmony_ci 32060ff233Sopenharmony_ci virtual int32_t OnChannelOpened(const char *sessionName, const ChannelInfo *channel); 33060ff233Sopenharmony_ci 34060ff233Sopenharmony_ci virtual int32_t OnChannelOpenFailed(int32_t channelId, int32_t channelType, int32_t errCode); 35060ff233Sopenharmony_ci 36060ff233Sopenharmony_ci virtual int32_t OnChannelLinkDown(const char *networkId, int32_t routeType); 37060ff233Sopenharmony_ci 38060ff233Sopenharmony_ci virtual int32_t OnChannelMsgReceived(int32_t channelId, int32_t channelType, const void *data, 39060ff233Sopenharmony_ci uint32_t len, int32_t type); 40060ff233Sopenharmony_ci 41060ff233Sopenharmony_ci virtual int32_t OnChannelClosed(int32_t channelId, int32_t channelType, int32_t messageType); 42060ff233Sopenharmony_ci 43060ff233Sopenharmony_ci virtual int32_t OnChannelQosEvent(int32_t channelId, int32_t channelType, int32_t eventId, int32_t tvCount, 44060ff233Sopenharmony_ci const QosTv *tvList); 45060ff233Sopenharmony_ci virtual int32_t SetChannelInfo(const char *sessionName, int32_t sessionId, int32_t channelId, int32_t channelType); 46060ff233Sopenharmony_ci 47060ff233Sopenharmony_ci virtual int32_t OnJoinLNNResult(void *addr, uint32_t addrTypeLen, const char *networkId, int retCode); 48060ff233Sopenharmony_ci 49060ff233Sopenharmony_ci virtual int32_t OnJoinMetaNodeResult(void *addr, uint32_t addrTypeLen, void *metaInfo, uint32_t infoLen, 50060ff233Sopenharmony_ci int retCode); 51060ff233Sopenharmony_ci 52060ff233Sopenharmony_ci virtual int32_t OnLeaveLNNResult(const char *networkId, int retCode); 53060ff233Sopenharmony_ci 54060ff233Sopenharmony_ci virtual int32_t OnLeaveMetaNodeResult(const char *networkId, int retCode); 55060ff233Sopenharmony_ci 56060ff233Sopenharmony_ci virtual int32_t OnNodeOnlineStateChanged(const char *pkgName, bool isOnline, void *info, uint32_t infoTypeLen); 57060ff233Sopenharmony_ci 58060ff233Sopenharmony_ci virtual int32_t OnNodeBasicInfoChanged(const char *pkgName, void *info, uint32_t infoTypeLen, int32_t type); 59060ff233Sopenharmony_ci 60060ff233Sopenharmony_ci virtual int32_t OnNodeStatusChanged(const char *pkgName, void *info, uint32_t infoTypeLen, int32_t type); 61060ff233Sopenharmony_ci 62060ff233Sopenharmony_ci virtual int32_t OnLocalNetworkIdChanged(const char *pkgName); 63060ff233Sopenharmony_ci 64060ff233Sopenharmony_ci virtual int32_t OnNodeDeviceTrustedChange(const char *pkgName, int32_t type, const char *msg, uint32_t msgLen); 65060ff233Sopenharmony_ci 66060ff233Sopenharmony_ci virtual int32_t OnHichainProofException( 67060ff233Sopenharmony_ci const char *pkgName, const char *deviceList, uint32_t deviceListLen, uint16_t deviceTypeId, int32_t errCode); 68060ff233Sopenharmony_ci 69060ff233Sopenharmony_ci virtual int32_t OnTimeSyncResult(const void *info, uint32_t infoTypeLen, int32_t retCode); 70060ff233Sopenharmony_ci 71060ff233Sopenharmony_ci virtual void OnPublishLNNResult(int32_t publishId, int32_t reason); 72060ff233Sopenharmony_ci 73060ff233Sopenharmony_ci virtual void OnRefreshLNNResult(int32_t refreshId, int32_t reason); 74060ff233Sopenharmony_ci 75060ff233Sopenharmony_ci virtual void OnRefreshDeviceFound(const void *device, uint32_t deviceLen); 76060ff233Sopenharmony_ci 77060ff233Sopenharmony_ci virtual void OnDataLevelChanged(const char *networkId, const DataLevelInfo *dataLevelInfo); 78060ff233Sopenharmony_ci 79060ff233Sopenharmony_ci virtual int32_t OnClientTransLimitChange(int32_t channelId, uint8_t tos); 80060ff233Sopenharmony_ci 81060ff233Sopenharmony_ci virtual int32_t OnChannelBind(int32_t channelId, int32_t channelType); 82060ff233Sopenharmony_cipublic: 83060ff233Sopenharmony_ci DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.ISoftBusClient"); 84060ff233Sopenharmony_ci}; 85060ff233Sopenharmony_ci} 86060ff233Sopenharmony_ci#endif 87