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 LNN_BUS_CENTER_IPC_H 17 #define LNN_BUS_CENTER_IPC_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 int32_t LnnIpcInit (void); 29 int32_t LnnIpcServerJoin(const char *pkgName, void *addr, uint32_t addrTypeLen); 30 int32_t MetaNodeIpcServerJoin(const char *pkgName, void *addr, CustomData *customData, uint32_t addrTypeLen); 31 int32_t LnnIpcServerLeave(const char *pkgName, const char *networkId); 32 int32_t MetaNodeIpcServerLeave(const char *pkgName, const char *networkId); 33 int32_t LnnIpcGetAllOnlineNodeInfo(const char *pkgName, void **info, uint32_t infoTypeLen, int *infoNum); 34 int32_t LnnIpcGetLocalDeviceInfo(const char *pkgName, void *info, uint32_t infoTypeLen); 35 int32_t LnnIpcGetNodeKeyInfo(const char *pkgName, const char *networkId, int key, unsigned char *buf, uint32_t len); 36 int32_t LnnIpcSetNodeDataChangeFlag(const char *pkgName, const char *networkId, uint16_t dataChangeFlag); 37 int32_t LnnIpcGetNodeKeyInfoLen(int32_t key); 38 int32_t LnnIpcStartTimeSync(const char *pkgName, const char *targetNetworkId, int32_t accuracy, int32_t period); 39 int32_t LnnIpcStopTimeSync(const char *pkgName, const char *targetNetworkId); 40 int32_t LnnIpcPublishLNN(const char *pkgName, const void *info, uint32_t infoTypeLen); 41 int32_t LnnIpcStopPublishLNN(const char *pkgName, int32_t publishId); 42 int32_t LnnIpcRefreshLNN(const char *pkgName, const void *info, uint32_t infoTypeLen); 43 int32_t LnnIpcStopRefreshLNN(const char *pkgName, int32_t refreshId); 44 int32_t LnnIpcActiveMetaNode(const MetaNodeConfigInfo *info, char *metaNodeId); 45 int32_t LnnIpcDeactiveMetaNode(const char *metaNodeId); 46 int32_t LnnIpcGetAllMetaNodeInfo(MetaNodeInfo *infos, int32_t *infoNum); 47 48 int32_t LnnIpcNotifyJoinResult(void *addr, uint32_t addrTypeLen, const char *networkId, int32_t retCode); 49 int32_t MetaNodeIpcNotifyJoinResult(void *addr, uint32_t addrTypeLen, const char *networkId, int32_t retCode); 50 int32_t LnnIpcNotifyLeaveResult(const char *networkId, int32_t retCode); 51 int32_t MetaNodeIpcNotifyLeaveResult(const char *networkId, int32_t retCode); 52 int32_t LnnIpcNotifyOnlineState(bool isOnline, void *info, uint32_t infoTypeLen); 53 int32_t LnnIpcNotifyBasicInfoChanged(void *info, uint32_t infoTypeLen, int32_t type); 54 int32_t LnnIpcNotifyTimeSyncResult(const char *pkgName, const void *info, uint32_t infoTypeLen, int32_t retCode); 55 56 int32_t LnnIpcShiftLNNGear(const char *pkgName, const char *callerId, const char *targetNetworkId, 57 const GearMode *mode); 58 59 void BusCenterServerDeathCallback(const char *pkgName); 60 61 #ifdef __cplusplus 62 } 63 #endif 64 #endif /* LNN_L2_BUS_CENTER_IPC_H */