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