1 /**
2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
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 * Description: ble cfg net api \n
16 *
17 * History: \n
18 * 2024-01-27, Create file. \n
19 */
20 #include "hilink_call.h"
21 #include "ble_cfg_net_api.h"
22
BLE_CfgNetInit(const BLE_InitPara * para,const BLE_CfgNetCb * callback)23 int BLE_CfgNetInit(const BLE_InitPara *para, const BLE_CfgNetCb *callback)
24 {
25 return hilink_call2(HILINK_CALL_BLE_CFG_NET_INIT, int,
26 const BLE_InitPara *, para, const BLE_CfgNetCb *, callback);
27 }
28
BLE_CfgNetDeInit(const BLE_GattHandleList * handleList,unsigned int flag)29 int BLE_CfgNetDeInit(const BLE_GattHandleList *handleList, unsigned int flag)
30 {
31 return hilink_call2(HILINK_CALL_BLE_CFG_NET_DE_INIT, int,
32 const BLE_GattHandleList *, handleList, unsigned int, flag);
33 }
34
BLE_CfgNetAdvCtrl(unsigned int advSecond)35 int BLE_CfgNetAdvCtrl(unsigned int advSecond)
36 {
37 return hilink_call1(HILINK_CALL_BLE_CFG_NET_ADV_CTRL, int, unsigned int, advSecond);
38 }
39
BLE_CfgNetAdvUpdate(const BLE_AdvInfo * advInfo)40 int BLE_CfgNetAdvUpdate(const BLE_AdvInfo *advInfo)
41 {
42 return hilink_call1(HILINK_CALL_BLE_CFG_NET_ADV_UPDATE, int, const BLE_AdvInfo *, advInfo);
43 }
44
BLE_CfgNetDisConnect(void)45 int BLE_CfgNetDisConnect(void)
46 {
47 return hilink_call0(HILINK_CALL_BLE_CFG_NET_DIS_CONNECT, int);
48 }
49
BLE_SendCustomData(BLE_DataType dataType,const unsigned char * buff,unsigned int len)50 int BLE_SendCustomData(BLE_DataType dataType, const unsigned char *buff, unsigned int len)
51 {
52 return hilink_call3(HILINK_CALL_BLE_SEND_CUSTOM_DATA, int,
53 BLE_DataType, dataType, const unsigned char *, buff, unsigned int, len);
54 }
55
BLE_GetAdvType(void)56 int BLE_GetAdvType(void)
57 {
58 return hilink_call0(HILINK_CALL_BLE_GET_ADV_TYPE, int);
59 }
60
BLE_SetAdvType(int type)61 void BLE_SetAdvType(int type)
62 {
63 hilink_call1(HILINK_CALL_BLE_SET_ADV_TYPE, void, int, type);
64 }
65
BLE_SetAdvNameMpp(const unsigned char * mpp,unsigned int len)66 int BLE_SetAdvNameMpp(const unsigned char *mpp, unsigned int len)
67 {
68 return hilink_call2(HILINK_CALL_BLE_SET_ADV_NAME_MPP, int,
69 const unsigned char *, mpp, unsigned int, len);
70 }
71
BLE_NearDiscoveryInit(const BLE_NearDiscoveryCb * cb)72 int BLE_NearDiscoveryInit(const BLE_NearDiscoveryCb *cb)
73 {
74 return hilink_call1(HILINK_CALL_BLE_NEAR_DISCOVERY_INIT, int, const BLE_NearDiscoveryCb *, cb);
75 }
76
BLE_NearDiscoveryEnable(unsigned long waitTime)77 int BLE_NearDiscoveryEnable(unsigned long waitTime)
78 {
79 return hilink_call1(HILINK_CALL_BLE_NEAR_DISCOVERY_ENABLE, int, unsigned long, waitTime);
80 }
81
HILINK_BT_GetTaskStackSize(const char * name,unsigned long * stackSize)82 int HILINK_BT_GetTaskStackSize(const char *name, unsigned long *stackSize)
83 {
84 return hilink_call2(HILINK_CALL_HILINK_BT_GET_TASK_STACK_SIZE, int,
85 const char *, name, unsigned long *, stackSize);
86 }
87
HILINK_BT_SetTaskStackSize(const char * name,unsigned long stackSize)88 int HILINK_BT_SetTaskStackSize(const char *name, unsigned long stackSize)
89 {
90 return hilink_call2(HILINK_CALL_HILINK_BT_SET_TASK_STACK_SIZE, int,
91 const char *, name, unsigned long, stackSize);
92 }