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 #include "bus_center_server_proxy.h"
17
18 #include "securec.h"
19
20 #include "lnn_bus_center_ipc.h"
21 #include "lnn_log.h"
22 #include "softbus_def.h"
23 #include "softbus_error_code.h"
24 #include "softbus_server_ipc_interface_code.h"
25
BusCenterServerProxyInit(void)26 int32_t BusCenterServerProxyInit(void)
27 {
28 LNN_LOGE(LNN_EVENT, "bus center get server proxy ok");
29 return SOFTBUS_OK;
30 }
31
BusCenterServerProxyDeInit(void)32 void BusCenterServerProxyDeInit(void)
33 {
34 LNN_LOGE(LNN_EVENT, "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
ServerIpcRegDataLevelChangeCb(const char * pkgName)57 int32_t ServerIpcRegDataLevelChangeCb(const char *pkgName)
58 {
59 (void)pkgName;
60 return SOFTBUS_FUNC_NOT_SUPPORT;
61 }
62
ServerIpcUnregDataLevelChangeCb(const char * pkgName)63 int32_t ServerIpcUnregDataLevelChangeCb(const char *pkgName)
64 {
65 (void)pkgName;
66 return SOFTBUS_FUNC_NOT_SUPPORT;
67 }
68
ServerIpcSetDataLevel(const DataLevel * dataLevel)69 int32_t ServerIpcSetDataLevel(const DataLevel *dataLevel)
70 {
71 (void)dataLevel;
72 return SOFTBUS_FUNC_NOT_SUPPORT;
73 }
74
ServerIpcRegRangeCbForMsdp(const char * pkgName)75 int32_t ServerIpcRegRangeCbForMsdp(const char *pkgName)
76 {
77 (void)pkgName;
78 return SOFTBUS_FUNC_NOT_SUPPORT;
79 }
80
ServerIpcUnregRangeCbForMsdp(const char * pkgName)81 int32_t ServerIpcUnregRangeCbForMsdp(const char *pkgName)
82 {
83 (void)pkgName;
84 return SOFTBUS_FUNC_NOT_SUPPORT;
85 }
86
ServerIpcTriggerRangeForMsdp(const char * pkgName,const RangeConfig * config)87 int32_t ServerIpcTriggerRangeForMsdp(const char *pkgName, const RangeConfig *config)
88 {
89 (void)pkgName;
90 (void)config;
91 return SOFTBUS_FUNC_NOT_SUPPORT;
92 }
93
ServerIpcStopRangeForMsdp(const char * pkgName,const RangeConfig * config)94 int32_t ServerIpcStopRangeForMsdp(const char *pkgName, const RangeConfig *config)
95 {
96 (void)pkgName;
97 (void)config;
98 return SOFTBUS_FUNC_NOT_SUPPORT;
99 }
100
ServerIpcJoinLNN(const char * pkgName,void * addr,uint32_t addrTypeLen,bool isForceJoin)101 int32_t ServerIpcJoinLNN(const char *pkgName, void *addr, uint32_t addrTypeLen, bool isForceJoin)
102 {
103 return LnnIpcServerJoin(pkgName, 0, addr, addrTypeLen, isForceJoin);
104 }
105
ServerIpcLeaveLNN(const char * pkgName,const char * networkId)106 int32_t ServerIpcLeaveLNN(const char *pkgName, const char *networkId)
107 {
108 return LnnIpcServerLeave(pkgName, 0, networkId);
109 }
110
ServerIpcStartTimeSync(const char * pkgName,const char * targetNetworkId,int32_t accuracy,int32_t period)111 int32_t ServerIpcStartTimeSync(const char *pkgName, const char *targetNetworkId, int32_t accuracy, int32_t period)
112 {
113 return LnnIpcStartTimeSync(pkgName, 0, targetNetworkId, accuracy, period);
114 }
115
ServerIpcStopTimeSync(const char * pkgName,const char * targetNetworkId)116 int32_t ServerIpcStopTimeSync(const char *pkgName, const char *targetNetworkId)
117 {
118 return LnnIpcStopTimeSync(pkgName, targetNetworkId, 0);
119 }
120
ServerIpcPublishLNN(const char * pkgName,const PublishInfo * info)121 int32_t ServerIpcPublishLNN(const char *pkgName, const PublishInfo *info)
122 {
123 return LnnIpcPublishLNN(pkgName, 0, info);
124 }
125
ServerIpcStopPublishLNN(const char * pkgName,int32_t publishId)126 int32_t ServerIpcStopPublishLNN(const char *pkgName, int32_t publishId)
127 {
128 return LnnIpcStopPublishLNN(pkgName, 0, publishId);
129 }
130
ServerIpcRefreshLNN(const char * pkgName,const SubscribeInfo * info)131 int32_t ServerIpcRefreshLNN(const char *pkgName, const SubscribeInfo *info)
132 {
133 return LnnIpcRefreshLNN(pkgName, 0, info);
134 }
135
ServerIpcStopRefreshLNN(const char * pkgName,int32_t refreshId)136 int32_t ServerIpcStopRefreshLNN(const char *pkgName, int32_t refreshId)
137 {
138 return LnnIpcStopRefreshLNN(pkgName, 0, refreshId);
139 }
140
ServerIpcActiveMetaNode(const char * pkgName,const MetaNodeConfigInfo * info,char * metaNodeId)141 int32_t ServerIpcActiveMetaNode(const char *pkgName, const MetaNodeConfigInfo *info, char *metaNodeId)
142 {
143 (void)pkgName;
144 return LnnIpcActiveMetaNode(info, metaNodeId);
145 }
146
ServerIpcDeactiveMetaNode(const char * pkgName,const char * metaNodeId)147 int32_t ServerIpcDeactiveMetaNode(const char *pkgName, const char *metaNodeId)
148 {
149 (void)pkgName;
150 return LnnIpcDeactiveMetaNode(metaNodeId);
151 }
152
ServerIpcGetAllMetaNodeInfo(const char * pkgName,MetaNodeInfo * infos,int32_t * infoNum)153 int32_t ServerIpcGetAllMetaNodeInfo(const char *pkgName, MetaNodeInfo *infos, int32_t *infoNum)
154 {
155 (void)pkgName;
156 return LnnIpcGetAllMetaNodeInfo(infos, infoNum);
157 }
158
ServerIpcShiftLNNGear(const char * pkgName,const char * callerId,const char * targetNetworkId,const GearMode * mode)159 int32_t ServerIpcShiftLNNGear(const char *pkgName, const char *callerId, const char *targetNetworkId,
160 const GearMode *mode)
161 {
162 return LnnIpcShiftLNNGear(pkgName, callerId, targetNetworkId, mode);
163 }
164
ServerIpcSyncTrustedRelationShip(const char * pkgName,const char * msg,uint32_t msgLen)165 int32_t ServerIpcSyncTrustedRelationShip(const char *pkgName, const char *msg, uint32_t msgLen)
166 {
167 (void)pkgName;
168 (void)msg;
169 (void)msgLen;
170 return SOFTBUS_FUNC_NOT_SUPPORT;
171 }
172
ServerIpcSetDisplayName(const char * pkgName,const char * nameData,uint32_t len)173 int32_t ServerIpcSetDisplayName(const char *pkgName, const char *nameData, uint32_t len)
174 {
175 (void)pkgName;
176 (void)nameData;
177 (void)len;
178 return SOFTBUS_FUNC_NOT_SUPPORT;
179 }