1 /* 2 * Copyright (c) 2021-2024 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 "data_level.h" 23 #include "data_level_inner.h" 24 #include "softbus_bus_center.h" 25 26 #ifdef __cplusplus 27 extern "C" { 28 #endif 29 30 int32_t BusCenterClientInit(void); 31 void BusCenterClientDeinit(void); 32 33 int32_t JoinLNNInner(const char *pkgName, ConnectionAddr *target, OnJoinLNNResult cb); 34 int32_t LeaveLNNInner(const char *pkgName, const char *networkId, OnLeaveLNNResult 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 RegDataLevelChangeCbInner(const char *pkgName, IDataLevelCb *callback); 43 int32_t UnregDataLevelChangeCbInner(const char *pkgName); 44 int32_t SetDataLevelInner(const DataLevel *dataLevel); 45 void RestartRegDataLevelChange(void); 46 47 int32_t StartTimeSyncInner(const char *pkgName, const char *targetNetworkId, TimeSyncAccuracy accuracy, 48 TimeSyncPeriod period, ITimeSyncCb *cb); 49 int32_t StopTimeSyncInner(const char *pkgName, const char *targetNetworkId); 50 int32_t PublishLNNInner(const char *pkgName, const PublishInfo *info, const IPublishCb *cb); 51 int32_t StopPublishLNNInner(const char *pkgName, int32_t publishId); 52 int32_t RefreshLNNInner(const char *pkgName, const SubscribeInfo *info, const IRefreshCallback *cb); 53 int32_t StopRefreshLNNInner(const char *pkgName, int32_t refreshId); 54 int32_t ActiveMetaNodeInner(const char *pkgName, const MetaNodeConfigInfo *info, char *metaNodeId); 55 int32_t DeactiveMetaNodeInner(const char *pkgName, const char *metaNodeId); 56 int32_t GetAllMetaNodeInfoInner(const char *pkgName, MetaNodeInfo *infos, int32_t *infoNum); 57 int32_t ShiftLNNGearInner(const char *pkgName, const char *callerId, const char *targetNetworkId, 58 const GearMode *mode); 59 60 int32_t LnnOnJoinResult(void *addr, const char *networkId, int32_t retCode); 61 int32_t LnnOnLeaveResult(const char *networkId, int32_t retCode); 62 int32_t LnnOnNodeOnlineStateChanged(const char *pkgName, bool isOnline, void *info); 63 int32_t LnnOnNodeBasicInfoChanged(const char *pkgName, void *info, int32_t type); 64 int32_t LnnOnNodeStatusChanged(const char *pkgName, void *info, int32_t type); 65 int32_t LnnOnLocalNetworkIdChanged(const char *pkgName); 66 int32_t LnnOnNodeDeviceNotTrusted(const char *pkgName, const char *msg); 67 int32_t LnnOnHichainProofException( 68 const char *pkgName, const char *proofInfo, uint32_t proofLen, uint16_t deviceTypeId, int32_t errCode); 69 int32_t LnnOnTimeSyncResult(const void *info, int32_t retCode); 70 void LnnOnPublishLNNResult(int32_t publishId, int32_t reason); 71 void LnnOnRefreshLNNResult(int32_t refreshId, int32_t reason); 72 void LnnOnRefreshDeviceFound(const void *device); 73 void LnnOnDataLevelChanged(const char *networkId, const DataLevelInfo *dataLevelInfo); 74 75 int32_t DiscRecoveryPublish(void); 76 int32_t DiscRecoverySubscribe(void); 77 int32_t DiscRecoveryPolicy(void); 78 79 #ifdef __cplusplus 80 } 81 #endif 82 #endif 83