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 CLIENT_BUS_CENTER_MANAGER_H 17 #define CLIENT_BUS_CENTER_MANAGER_H 18 19 #include <stdbool.h> 20 #include <stdint.h> 21 22 #include "softbus_bus_center.h" 23 24 #ifdef __cplusplus 25 extern "C" { 26 #endif 27 28 int BusCenterClientInit(void); 29 void BusCenterClientDeinit(void); 30 31 int32_t JoinLNNInner(const char *pkgName, ConnectionAddr *target, OnJoinLNNResult cb); 32 int32_t JoinMetaNodeInner(const char *pkgName, ConnectionAddr *target, CustomData *customData, OnJoinMetaNodeResult cb); 33 int32_t LeaveLNNInner(const char *pkgName, const char *networkId, OnLeaveLNNResult cb); 34 int32_t LeaveMetaNodeInner(const char *pkgName, const char *networkId, OnLeaveMetaNodeResult cb); 35 int32_t RegNodeDeviceStateCbInner(const char *pkgName, INodeStateCb *callback); 36 int32_t UnregNodeDeviceStateCbInner(INodeStateCb *callback); 37 int32_t GetAllNodeDeviceInfoInner(const char *pkgName, NodeBasicInfo **info, int32_t *infoNum); 38 int32_t GetLocalNodeDeviceInfoInner(const char *pkgName, NodeBasicInfo *info); 39 int32_t GetNodeKeyInfoInner(const char *pkgName, const char *networkId, 40 NodeDeviceInfoKey key, uint8_t *info, int32_t infoLen); 41 int32_t SetNodeDataChangeFlagInner(const char *pkgName, const char *networkId, uint16_t dataChangeFlag); 42 int32_t StartTimeSyncInner(const char *pkgName, const char *targetNetworkId, TimeSyncAccuracy accuracy, 43 TimeSyncPeriod period, ITimeSyncCb *cb); 44 int32_t StopTimeSyncInner(const char *pkgName, const char *targetNetworkId); 45 int32_t PublishLNNInner(const char *pkgName, const PublishInfo *info, const IPublishCb *cb); 46 int32_t StopPublishLNNInner(const char *pkgName, int32_t publishId); 47 int32_t RefreshLNNInner(const char *pkgName, const SubscribeInfo *info, const IRefreshCallback *cb); 48 int32_t StopRefreshLNNInner(const char *pkgName, int32_t refreshId); 49 int32_t ActiveMetaNodeInner(const char *pkgName, const MetaNodeConfigInfo *info, char *metaNodeId); 50 int32_t DeactiveMetaNodeInner(const char *pkgName, const char *metaNodeId); 51 int32_t GetAllMetaNodeInfoInner(const char *pkgName, MetaNodeInfo *infos, int32_t *infoNum); 52 int32_t ShiftLNNGearInner(const char *pkgName, const char *callerId, const char *targetNetworkId, 53 const GearMode *mode); 54 55 int32_t LnnOnJoinResult(void *addr, const char *networkId, int32_t retCode); 56 int32_t MetaNodeOnJoinResult(void *addr, const char *networkId, int32_t retCode); 57 int32_t LnnOnLeaveResult(const char *networkId, int32_t retCode); 58 int32_t MetaNodeOnLeaveResult(const char *networkId, int32_t retCode); 59 int32_t LnnOnNodeOnlineStateChanged(bool isOnline, void *info); 60 int32_t LnnOnNodeBasicInfoChanged(void *info, int32_t type); 61 int32_t LnnOnTimeSyncResult(const void *info, int retCode); 62 void LnnOnPublishLNNResult(int32_t publishId, int32_t reason); 63 void LnnOnRefreshLNNResult(int32_t refreshId, int32_t reason); 64 void LnnOnRefreshDeviceFound(const void *device); 65 66 #ifdef __cplusplus 67 } 68 #endif 69 #endif