• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 }
36 
ServerIpcGetAllOnlineNodeInfo(const char * pkgName,void ** info,uint32_t infoTypeLen,int32_t * infoNum)37 int32_t ServerIpcGetAllOnlineNodeInfo(const char *pkgName, void **info, uint32_t infoTypeLen, int32_t *infoNum)
38 {
39     return LnnIpcGetAllOnlineNodeInfo(pkgName, info, infoTypeLen, infoNum);
40 }
41 
ServerIpcGetLocalDeviceInfo(const char * pkgName,void * info,uint32_t infoTypeLen)42 int32_t ServerIpcGetLocalDeviceInfo(const char *pkgName, void *info, uint32_t infoTypeLen)
43 {
44     return LnnIpcGetLocalDeviceInfo(pkgName, info, infoTypeLen);
45 }
46 
ServerIpcGetNodeKeyInfo(const char * pkgName,const char * networkId,int key,unsigned char * buf,uint32_t len)47 int32_t ServerIpcGetNodeKeyInfo(const char *pkgName, const char *networkId, int key, unsigned char *buf, uint32_t len)
48 {
49     return LnnIpcGetNodeKeyInfo(pkgName, networkId, key, buf, len);
50 }
51 
ServerIpcSetNodeDataChangeFlag(const char * pkgName,const char * networkId,uint16_t dataChangeFlag)52 int32_t ServerIpcSetNodeDataChangeFlag(const char *pkgName, const char *networkId, uint16_t dataChangeFlag)
53 {
54     return LnnIpcSetNodeDataChangeFlag(pkgName, networkId, dataChangeFlag);
55 }
56 
ServerIpcJoinLNN(const char * pkgName,void * addr,unsigned int addrTypeLen)57 int32_t ServerIpcJoinLNN(const char *pkgName, void *addr, unsigned int addrTypeLen)
58 {
59     return LnnIpcServerJoin(pkgName, addr, addrTypeLen);
60 }
61 
ServerIpcJoinMetaNode(const char * pkgName,void * addr,CustomData * customData,unsigned int addrTypeLen)62 int32_t ServerIpcJoinMetaNode(const char *pkgName, void *addr, CustomData *customData, unsigned int addrTypeLen)
63 {
64     (void)pkgName;
65     (void)addr;
66     (void)customData;
67     (void)addrTypeLen;
68     return SOFTBUS_OK;
69 }
70 
ServerIpcLeaveLNN(const char * pkgName,const char * networkId)71 int32_t ServerIpcLeaveLNN(const char *pkgName, const char *networkId)
72 {
73     return LnnIpcServerLeave(pkgName, networkId);
74 }
75 
ServerIpcLeaveMetaNode(const char * pkgName,const char * networkId)76 int32_t ServerIpcLeaveMetaNode(const char *pkgName, const char *networkId)
77 {
78     (void)pkgName;
79     (void)networkId;
80     return SOFTBUS_OK;
81 }
82 
ServerIpcStartTimeSync(const char * pkgName,const char * targetNetworkId,int32_t accuracy,int32_t period)83 int32_t ServerIpcStartTimeSync(const char *pkgName, const char *targetNetworkId, int32_t accuracy, int32_t period)
84 {
85     return LnnIpcStartTimeSync(pkgName, targetNetworkId, accuracy, period);
86 }
87 
ServerIpcStopTimeSync(const char * pkgName,const char * targetNetworkId)88 int32_t ServerIpcStopTimeSync(const char *pkgName, const char *targetNetworkId)
89 {
90     return LnnIpcStopTimeSync(pkgName, targetNetworkId);
91 }
92 
ServerIpcPublishLNN(const char * pkgName,const void * info,uint32_t infoLen)93 int32_t ServerIpcPublishLNN(const char *pkgName, const void *info, uint32_t infoLen)
94 {
95     return LnnIpcPublishLNN(pkgName, info, infoLen);
96 }
97 
ServerIpcStopPublishLNN(const char * pkgName,int32_t publishId)98 int32_t ServerIpcStopPublishLNN(const char *pkgName, int32_t publishId)
99 {
100     return LnnIpcStopPublishLNN(pkgName, publishId);
101 }
102 
ServerIpcRefreshLNN(const char * pkgName,const void * info,uint32_t infoTypeLen)103 int32_t ServerIpcRefreshLNN(const char *pkgName, const void *info, uint32_t infoTypeLen)
104 {
105     return LnnIpcRefreshLNN(pkgName, info, infoTypeLen);
106 }
107 
ServerIpcStopRefreshLNN(const char * pkgName,int32_t refreshId)108 int32_t ServerIpcStopRefreshLNN(const char *pkgName, int32_t refreshId)
109 {
110     return LnnIpcStopRefreshLNN(pkgName, refreshId);
111 }
112 
ServerIpcActiveMetaNode(const char * pkgName,const MetaNodeConfigInfo * info,char * metaNodeId)113 int32_t ServerIpcActiveMetaNode(const char *pkgName, const MetaNodeConfigInfo *info, char *metaNodeId)
114 {
115     (void)pkgName;
116     return LnnIpcActiveMetaNode(info, metaNodeId);
117 }
118 
ServerIpcDeactiveMetaNode(const char * pkgName,const char * metaNodeId)119 int32_t ServerIpcDeactiveMetaNode(const char *pkgName, const char *metaNodeId)
120 {
121     (void)pkgName;
122     return LnnIpcDeactiveMetaNode(metaNodeId);
123 }
124 
ServerIpcGetAllMetaNodeInfo(const char * pkgName,MetaNodeInfo * infos,int32_t * infoNum)125 int32_t ServerIpcGetAllMetaNodeInfo(const char *pkgName, MetaNodeInfo *infos, int32_t *infoNum)
126 {
127     (void)pkgName;
128     return LnnIpcGetAllMetaNodeInfo(infos, infoNum);
129 }
130 
ServerIpcShiftLNNGear(const char * pkgName,const char * callerId,const char * targetNetworkId,const GearMode * mode)131 int32_t ServerIpcShiftLNNGear(const char *pkgName, const char *callerId, const char *targetNetworkId,
132     const GearMode *mode)
133 {
134     return LnnIpcShiftLNNGear(pkgName, callerId, targetNetworkId, mode);
135 }