• 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 LNN_BUS_CENTER_IPC_H
17 #define LNN_BUS_CENTER_IPC_H
18 
19 #include <stdbool.h>
20 #include <stdint.h>
21 
22 #include "ble_range.h"
23 #include "data_level.h"
24 #include "softbus_bus_center.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 int32_t LnnIpcInit(void);
31 void LnnIpcDeinit(void);
32 int32_t LnnIpcServerJoin(const char *pkgName, int32_t callingPid, void *addr, uint32_t addrTypeLen, bool isForceJoin);
33 int32_t LnnIpcServerLeave(const char *pkgName, int32_t callingPid, const char *networkId);
34 int32_t LnnIpcGetAllOnlineNodeInfo(const char *pkgName, void **info, uint32_t infoTypeLen, int32_t *infoNum);
35 int32_t LnnIpcGetLocalDeviceInfo(const char *pkgName, void *info, uint32_t infoTypeLen);
36 int32_t LnnIpcGetNodeKeyInfo(const char *pkgName, const char *networkId, int32_t key, unsigned char *buf, uint32_t len);
37 int32_t LnnIpcSetNodeDataChangeFlag(const char *pkgName, const char *networkId, uint16_t dataChangeFlag);
38 int32_t LnnIpcRegDataLevelChangeCb(const char *pkgName, int32_t callingPid);
39 int32_t LnnIpcUnregDataLevelChangeCb(const char *pkgName, int32_t callingPid);
40 int32_t LnnIpcSetDataLevel(const DataLevel *dataLevel);
41 int32_t LnnIpcGetNodeKeyInfoLen(int32_t key);
42 int32_t LnnIpcStartTimeSync(
43     const char *pkgName, int32_t callingPid, const char *targetNetworkId, int32_t accuracy, int32_t period);
44 int32_t LnnIpcStopTimeSync(const char *pkgName, const char *targetNetworkId, int32_t callingPid);
45 int32_t LnnIpcPublishLNN(const char *pkgName, int32_t callingPid, const PublishInfo *info);
46 int32_t LnnIpcStopPublishLNN(const char *pkgName, int32_t callingPid, int32_t publishId);
47 int32_t LnnIpcRefreshLNN(const char *pkgName, int32_t callingPid, const SubscribeInfo *info);
48 int32_t LnnIpcStopRefreshLNN(const char *pkgName, int32_t callingPid, int32_t refreshId);
49 int32_t LnnIpcActiveMetaNode(const MetaNodeConfigInfo *info, char *metaNodeId);
50 int32_t LnnIpcDeactiveMetaNode(const char *metaNodeId);
51 int32_t LnnIpcGetAllMetaNodeInfo(MetaNodeInfo *infos, int32_t *infoNum);
52 
53 int32_t LnnIpcNotifyJoinResult(void *addr, uint32_t addrTypeLen, const char *networkId, int32_t retCode);
54 int32_t LnnIpcNotifyLeaveResult(const char *networkId, int32_t retCode);
55 int32_t LnnIpcNotifyOnlineState(bool isOnline, void *info, uint32_t infoTypeLen);
56 int32_t LnnIpcNotifyBasicInfoChanged(void *info, uint32_t infoTypeLen, int32_t type);
57 int32_t LnnIpcNotifyNodeStatusChanged(void *info, uint32_t infoTypeLen, int32_t type);
58 int32_t LnnIpcLocalNetworkIdChanged(void);
59 int32_t LnnIpcNotifyDeviceTrustedChange(int32_t type, const char *msg, uint32_t msgLen);
60 int32_t LnnIpcNotifyHichainProofException(
61     const char *proofInfo, uint32_t proofLen, uint16_t deviceTypeId, int32_t errCode);
62 int32_t LnnIpcNotifyTimeSyncResult(
63     const char *pkgName, int32_t pid, const void *info, uint32_t infoTypeLen, int32_t retCode);
64 
65 int32_t LnnIpcShiftLNNGear(const char *pkgName, const char *callerId, const char *targetNetworkId,
66     const GearMode *mode);
67 int32_t LnnIpcTriggerRangeForMsdp(const char *pkgName, const RangeConfig *config);
68 int32_t LnnIpcStopRangeForMsdp(const char *pkgName, const RangeConfig *config);
69 int32_t LnnIpcRegRangeCbForMsdp(const char *pkgName, int32_t callingPid);
70 int32_t LnnIpcUnregRangeCbForMsdp(const char *pkgName, int32_t callingPid);
71 int32_t LnnIpcSyncTrustedRelationShip(const char *pkgName, const char *msg, uint32_t msgLen);
72 int32_t LnnIpcSetDisplayName(const char *pkgName, const char *nameData, uint32_t len);
73 
74 void BusCenterServerDeathCallback(const char *pkgName);
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 #endif /* LNN_L2_BUS_CENTER_IPC_H */
80