-
Notifications
You must be signed in to change notification settings - Fork 1
/
wiced_bt_pan.h
317 lines (292 loc) · 12.3 KB
/
wiced_bt_pan.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
/*
* Copyright 2016-2024, Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* This software, including source code, documentation and related
* materials ("Software") is owned by Cypress Semiconductor Corporation
* or one of its affiliates ("Cypress") and is protected by and subject to
* worldwide patent protection (United States and foreign),
* United States copyright laws and international treaty provisions.
* Therefore, you may use this Software only as provided in the license
* agreement accompanying the software package from which you
* obtained this Software ("EULA").
* If no EULA applies, Cypress hereby grants you a personal, non-exclusive,
* non-transferable license to copy, modify, and compile the Software
* source code solely for use in connection with Cypress's
* integrated circuit products. Any reproduction, modification, translation,
* compilation, or representation of this Software except as specified
* above is prohibited without the express written permission of Cypress.
*
* Disclaimer: THIS SOFTWARE IS PROVIDED AS-IS, WITH NO WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT, IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress
* reserves the right to make changes to the Software without notice. Cypress
* does not assume any liability arising out of the application or use of the
* Software or any product or circuit described in the Software. Cypress does
* not authorize its products for use in any products where a malfunction or
* failure of the Cypress product may reasonably be expected to result in
* significant property damage, injury or death ("High Risk Product"). By
* including Cypress's product in a High Risk Product, the manufacturer
* of such system or application assumes all risk of such use and in doing
* so agrees to indemnify Cypress against all liability.
*/
/**************************************************************************//**
* \file
*
* \brief This file provides definitions of the persnoal access network(PAN)
* library interface.
*
******************************************************************************/
#ifndef WICED_BT_PAN_H
#define WICED_BT_PAN_H
#if defined(WICED_APP_PANU_INCLUDED) || defined(WICED_APP_PANNAP_INCLUDED)
#ifdef __cplusplus
extern "C" {
#endif
/**
* \addtogroup wiced_bt_pan_api_functions PAN Library API
* \ingroup wicedbt
* @{
* PAN library of the AIROC BTSDK provide a simple method for an application to integrate PAN
* functionality. Application calls the library APIs to init/register/connect/disconnect and
* send data. Library in turn indicates status of the connection and passes to the application.
*/
#include "pan_api.h"
/*****************************************************************************
* Function Prototypes
*****************************************************************************/
/*****************************************************************************
*
* Function Name: wiced_bt_panu_sdp_init
*
***************************************************************************//**
*
* This function initializes the pan sdp unit. It should be called
* before accessing any other APIs to initialize the control block
*
* \param none.
*
* \return none.
*
*****************************************************************************/
void wiced_bt_panu_sdp_init(void);
/*****************************************************************************
*
* Function Name: wiced_bt_bnep_init
*
***************************************************************************//**
*
* This function initializes the BNEP unit. It should be called
* before accessing any other APIs to initialize the control block
*
* \param none.
*
* \return none.
*
*****************************************************************************/
void wiced_bt_bnep_init(void);
/*****************************************************************************
*
* Function Name: wiced_bt_pan_init
*
***************************************************************************//**
*
* This function initializes the PAN unit. It should be called
* before accessing any other APIs to initialize the control block.
*
* \param none.
*
* \return none.
*
*****************************************************************************/
void wiced_bt_pan_init(void);
/*****************************************************************************
*
* Function Name: wiced_bt_pan_register
*
***************************************************************************//**
*
* This function is called by the application to register
* its callbacks with PAN profile. The application then
* should set the PAN role explicitly.
*
* \param p_register: contains all callback function pointers.
*
* \return none
*
*****************************************************************************/
void wiced_bt_pan_register(tPAN_REGISTER *p_register);
/*****************************************************************************
*
* Function Name: wiced_bt_pan_setrole
*
***************************************************************************//**
*
* This function is called by the application to set the PAN
* profile role. This should be called after wiced_bt_pan_register.
* This can be called any time to change the PAN role.
*
* \param role: is bit map of roles to be active
* PAN_ROLE_CLIENT is for PANU role
* PAN_ROLE_GN_SERVER is for GN role
* PAN_ROLE_NAP_SERVER is for NAP role.
*
* \return Status of the PAN operation.
*
*****************************************************************************/
tPAN_RESULT wiced_bt_pan_setrole(uint8_t role);
/*****************************************************************************
*
* Function Name: wiced_bt_pan_writebuf
*
***************************************************************************//**
*
* This sends data over the PAN connections. If this is called
* on GN or NAP side and the packet is multicast or broadcast
* it will be sent on all the links. Otherwise the correct link
* is found based on the destination address and forwarded on it
* If the return value is not PAN_SUCCESS the application should
* take care of releasing the message buffer.
*
* \param handle: PAN connection handle.
* \param dst: MAC or BD Addr of the destination device.
* \param src: MAC or BD Addr of the source who sent this packet.
* \param protocol: protocol of the ethernet packet like IP or ARP.
* \param p_buf: pointer to the data buffer.
* \param ext: to indicate that extension headers present.
*
* \return Status of the PAN operation.
*
*****************************************************************************/
tPAN_RESULT wiced_bt_pan_writebuf(uint16_t handle,
BD_ADDR dst,
BD_ADDR src,
uint16_t protocol,
BT_HDR *p_buf,
BOOLEAN ext);
/*****************************************************************************
*
* Function Name: wiced_bt_pan_set_multicast_filters
*
***************************************************************************//**
*
* This function is used to set multicast filters on the peer.
*
* \param handle: handle for the connection.
* \param num_filters: number of multicast filter ranges.
* \param p_start_array: Pointer to sequence of beginings of all
* multicast address ranges.
* \param p_end_array: Pointer to sequence of ends of all
* multicast address ranges.
*
* \return Status of the PAN operation.
*
*****************************************************************************/
tBNEP_RESULT wiced_bt_pan_set_multicast_filters(uint16_t handle,
uint16_t num_mcast_filters,
uint8_t *p_start_array,
uint8_t *p_end_array);
/*****************************************************************************
*
* Function Name: wiced_bt_pan_set_protocol_filters
*
***************************************************************************//**
*
* This function is used to set protocol filters on the peer.
*
* \param handle: handle for the connection.
* \param num_filters: number of protocol filter ranges.
* \param p_start_array: array of starting protocol numbers
* \param p_end_array: array of ending protocol numbers
*
* \return Status of the PAN operation.
*
*****************************************************************************/
tPAN_RESULT wiced_bt_pan_set_protocol_filters(uint16_t handle,
uint16_t num_filters,
uint16_t *p_start_array,
uint16_t *p_end_array);
/*****************************************************************************
*
* Function Name: wiced_bt_pan_deregister
*
***************************************************************************//**
*
* This function is called by the application to de-register
* its callbacks with PAN profile. This will make the PAN to
* become inactive. This will deregister PAN services from SDP
* and close all active connections.
*
* \param none
*
* \return none
*
*****************************************************************************/
void wiced_bt_pan_deregister(void);
/*****************************************************************************
*
* Function Name: wiced_bt_pan_connect
*
***************************************************************************//**
*
* This function is called by the application to initiate a
* connection to the remote device.
*
* \param rem_bda: BD Addr of the remote device.
* \param src_role: Role of the local device for the connection.
* \param dst_role: Role of the remote device for the connection
* \param handle: Pointer for returning Handle to the connection
*
* \return Status of the PAN operation.
*
*****************************************************************************/
tPAN_RESULT wiced_bt_pan_connect(BD_ADDR rem_bda, uint8_t src_role,
uint8_t dst_role, uint16_t *handle);
/*****************************************************************************
*
* Function Name: wiced_bt_pan_disconnect
*
***************************************************************************//**
*
* This is used to disconnect the connection.
*
* \param handle: handle for the connection
*
* \return Status of the PAN operation.
*
*****************************************************************************/
tPAN_RESULT wiced_bt_pan_disconnect(uint16_t handle);
/*****************************************************************************
*
* Function Name: wiced_bt_panu_connect
*
***************************************************************************//**
*
* This function do sdp search and then connect request from panu to the NAP.
*
* \param bd_addr: BD Addr of the remote device.
*
* \return none
*
*****************************************************************************/
void wiced_bt_panu_connect(BD_ADDR bd_addr);
/*****************************************************************************
*
* Function Name: wiced_bt_panu_disconnect
*
***************************************************************************//**
*
* This function disconnect request from panu to the NAP.
*
* \param handle: handle for the connection.
*
* \return none
*
*****************************************************************************/
void wiced_bt_panu_disconnect(uint16_t handle);
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* defined(WICED_APP_PANU_INCLUDED) || defined(WICED_APP_PANNAP_INCLUDED) */
#endif /* WICED_BT_PAN_H */