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 #include "bus_center_server_proxy.h"
17
18 #include "securec.h"
19
20 #include "lnn_bus_center_ipc.h"
21 #include "softbus_def.h"
22 #include "softbus_errcode.h"
23 #include "softbus_ipc_def.h"
24 #include "softbus_log.h"
25
BusCenterServerProxyInit(void)26 int32_t BusCenterServerProxyInit(void)
27 {
28 SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "bus center get server proxy ok");
29 return SOFTBUS_OK;
30 }
31
BusCenterServerProxyDeInit(void)32 void BusCenterServerProxyDeInit(void)
33 {
34 SoftBusLog(SOFTBUS_LOG_LNN, SOFTBUS_LOG_ERROR, "bus center delete server proxy ok");
35 return SOFTBUS_OK;
36 }
37
ServerIpcGetAllOnlineNodeInfo(const char * pkgName,void ** info,uint32_t infoTypeLen,int32_t * infoNum)38 int32_t ServerIpcGetAllOnlineNodeInfo(const char *pkgName, void **info, uint32_t infoTypeLen, int32_t *infoNum)
39 {
40 return LnnIpcGetAllOnlineNodeInfo(pkgName, info, infoTypeLen, infoNum);
41 }
42
ServerIpcGetLocalDeviceInfo(const char * pkgName,void * info,uint32_t infoTypeLen)43 int32_t ServerIpcGetLocalDeviceInfo(const char *pkgName, void *info, uint32_t infoTypeLen)
44 {
45 return LnnIpcGetLocalDeviceInfo(pkgName, info, infoTypeLen);
46 }
47
ServerIpcGetNodeKeyInfo(const char * pkgName,const char * networkId,int key,unsigned char * buf,uint32_t len)48 int32_t ServerIpcGetNodeKeyInfo(const char *pkgName, const char *networkId, int key, unsigned char *buf, uint32_t len)
49 {
50 return LnnIpcGetNodeKeyInfo(pkgName, networkId, key, buf, len);
51 }
52
ServerIpcJoinLNN(const char * pkgName,void * addr,unsigned int addrTypeLen)53 int32_t ServerIpcJoinLNN(const char *pkgName, void *addr, unsigned int addrTypeLen)
54 {
55 return LnnIpcServerJoin(pkgName, addr, addrTypeLen);
56 }
57
ServerIpcLeaveLNN(const char * pkgName,const char * networkId)58 int32_t ServerIpcLeaveLNN(const char *pkgName, const char *networkId)
59 {
60 return LnnIpcServerLeave(pkgName, networkId);
61 }
62
ServerIpcStartTimeSync(const char * pkgName,const char * targetNetworkId,int32_t accuracy,int32_t period)63 int32_t ServerIpcStartTimeSync(const char *pkgName, const char *targetNetworkId, int32_t accuracy, int32_t period)
64 {
65 return LnnIpcStartTimeSync(pkgName, targetNetworkId, accuracy, period);
66 }
67
ServerIpcStopTimeSync(const char * pkgName,const char * targetNetworkId)68 int32_t ServerIpcStopTimeSync(const char *pkgName, const char *targetNetworkId)
69 {
70 return LnnIpcStopTimeSync(pkgName, targetNetworkId);
71 }
72
ServerIpcPublishLNN(const char * pkgName,const PublishInfo * info)73 int32_t ServerIpcPublishLNN(const char *pkgName, const PublishInfo *info)
74 {
75 return LnnIpcPublishLNN(pkgName, info);
76 }
77
ServerIpcStopPublishLNN(const char * pkgName,int32_t publishId)78 int32_t ServerIpcStopPublishLNN(const char *pkgName, int32_t publishId)
79 {
80 return LnnIpcStopPublishLNN(pkgName, publishId);
81 }
82
ServerIpcRefreshLNN(const char * pkgName,const SubscribeInfo * info)83 int32_t ServerIpcRefreshLNN(const char *pkgName, const SubscribeInfo *info)
84 {
85 return LnnIpcRefreshLNN(pkgName, info);
86 }
87
ServerIpcStopRefreshLNN(const char * pkgName,int32_t refreshId)88 int32_t ServerIpcStopRefreshLNN(const char *pkgName, int32_t refreshId)
89 {
90 return LnnIpcStopRefreshLNN(pkgName, refreshId);
91 }
92
ServerIpcActiveMetaNode(const char * pkgName,const MetaNodeConfigInfo * info,char * metaNodeId)93 int32_t ServerIpcActiveMetaNode(const char *pkgName, const MetaNodeConfigInfo *info, char *metaNodeId)
94 {
95 (void)pkgName;
96 return LnnIpcActiveMetaNode(info, metaNodeId);
97 }
98
ServerIpcDeactiveMetaNode(const char * pkgName,const char * metaNodeId)99 int32_t ServerIpcDeactiveMetaNode(const char *pkgName, const char *metaNodeId)
100 {
101 (void)pkgName;
102 return LnnIpcDeactiveMetaNode(metaNodeId);
103 }
104
ServerIpcGetAllMetaNodeInfo(const char * pkgName,MetaNodeInfo * infos,int32_t * infoNum)105 int32_t ServerIpcGetAllMetaNodeInfo(const char *pkgName, MetaNodeInfo *infos, int32_t *infoNum)
106 {
107 (void)pkgName;
108 return LnnIpcGetAllMetaNodeInfo(infos, infoNum);
109 }
110