Mistake on this page?
Report an issue in GitHub or email us
l2c_api.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief L2CAP subsystem API.
6  *
7  * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved.
8  *
9  * Copyright (c) 2019-2020 Packetcraft, Inc.
10  *
11  * Licensed under the Apache License, Version 2.0 (the "License");
12  * you may not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  * http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  */
23 /*************************************************************************************************/
24 #ifndef L2C_API_H
25 #define L2C_API_H
26 
27 #include "dm_api.h"
28 #include "l2c_defs.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 /*! \addtogroup STACK_L2CAP_API
35  * \{ */
36 
37 /**************************************************************************************************
38  Macros
39 **************************************************************************************************/
40 
41 /** \name L2CAP Control Callback Events
42  * Control callback message events
43  */
44 /**@{*/
45 #define L2C_CTRL_FLOW_ENABLE_IND 0 /*!< \brief Data flow enabled */
46 #define L2C_CTRL_FLOW_DISABLE_IND 1 /*!< \brief Data flow disabled */
47 /**@}*/
48 
49 /*! \brief Invalid channel registration ID for connection oriented channels */
50 #define L2C_COC_REG_ID_NONE 0
51 
52 /*! \brief Invalid channel ID for connection oriented channels */
53 #define L2C_COC_CID_NONE 0
54 
55 /*! \brief Invalid signal identifier */
56 #define L2C_SIGNAL_ID_INVALID 0
57 
58 /** \name L2CAP COC Channel Roles
59  * Connection oriented channel initiator/acceptor role
60  */
61 /**@{*/
62 #define L2C_COC_ROLE_NONE 0x00 /*!< \brief No role (unallocated) */
63 #define L2C_COC_ROLE_INITIATOR 0x01 /*!< \brief Channel initiator */
64 #define L2C_COC_ROLE_ACCEPTOR 0x02 /*!< \brief Channel acceptor */
65 /**@}*/
66 
67 /** \name L2CAP COC Data Confirm Codes
68  * Connection oriented channel data confirm status values
69  */
70 /**@{*/
71 #define L2C_COC_DATA_SUCCESS 0 /*!< \brief Data request successful */
72 #define L2C_COC_DATA_ERR_MEMORY 1 /*!< \brief Out of memory */
73 #define L2C_COC_DATA_ERR_OVERFLOW 2 /*!< \brief Transaction overflow */
74 /**@}*/
75 
76 /** \name L2CAP COC Callback Events
77  * Connection oriented channel callback events.
78  */
79 /**@{*/
80 #define L2C_COC_CBACK_START 0x70 /*!< \brief L2C callback event starting value */
81 /*! \brief COC callback events */
82 enum
83 {
84  L2C_COC_CONNECT_IND = L2C_COC_CBACK_START, /*!< \brief Channel connect indication */
85  L2C_COC_DISCONNECT_IND, /*!< \brief Channel disconnect indication */
86  L2C_COC_EN_CONNECT_IND, /*!< \brief Received enhanced connection indication */
87  L2C_COC_EN_RECONFIG_IND, /*!< \brief Received enhanced reconfiguration indication */
88  L2C_COC_DATA_IND, /*!< \brief Received data indication */
89  L2C_COC_DATA_CNF /*!< \brief Transmit data confirm */
90 };
91 
92 #define L2C_COC_CBACK_CBACK_END L2C_COC_DATA_CNF /*!< \brief L2C callback event ending value */
93 /**@}*/
94 
95 /**************************************************************************************************
96  Data Types
97 **************************************************************************************************/
98 
99 /*! \brief Connection oriented channel registration ID */
100 typedef uint16_t l2cCocRegId_t;
101 
102 /*! \brief Connection oriented channel registration structure */
103 typedef struct
104 {
105  uint16_t psm; /*!< \brief Protocol service multiplexer */
106  uint16_t mps; /*!< \brief Maximum receive PDU fragment size */
107  uint16_t mtu; /*!< \brief Maximum receive data packet size */
108  uint16_t credits; /*!< \brief Data packet receive credits for this channel */
109  bool_t authoriz; /*!< \brief TRUE if authorization is required */
110  uint8_t secLevel; /*!< \brief Channel minimum security level requirements */
111  uint8_t role; /*!< \brief Channel initiator/acceptor role */
112 } l2cCocReg_t;
113 
114 /*! \brief Connection oriented channel connect indication structure */
115 typedef struct
116 {
117  wsfMsgHdr_t hdr; /*!< \brief Header structure */
118  uint16_t cid; /*!< \brief Local channel ID */
119  uint16_t peerMtu; /*!< \brief Data packet MTU peer can receive */
120  uint16_t psm; /*!< \brief Connected PSM */
122 
123 /*! \brief Connection oriented channel disconnect indication structure */
124 typedef struct
125 {
126  wsfMsgHdr_t hdr; /*!< \brief Header structure */
127  uint16_t cid; /*!< \brief Local channel ID */
128  uint16_t result; /*!< \brief Connection failure result code */
130 
131 /*! \brief Connection oriented channel data indication structure */
132 typedef struct
133 {
134  wsfMsgHdr_t hdr; /*!< \brief Header structure */
135  uint16_t cid; /*!< \brief Local channel ID */
136  uint8_t *pData; /*!< \brief Pointer to packet data */
137  uint16_t dataLen; /*!< \brief packet data length */
139 
140 /*! \brief Connection oriented channel disconnect indication structure */
141 typedef struct
142 {
143  wsfMsgHdr_t hdr; /*!< \brief Header structure */
144  uint16_t cid; /*!< \brief Local channel ID */
146 
147 /*! \brief Enhanced connection oriented channel connect indication structure */
148 typedef struct
149 {
150  wsfMsgHdr_t hdr; /*!< \brief Header structure */
151  uint16_t mps; /*!< \brief Data packet MPS peer can receive */
152  uint16_t mtu; /*!< \brief Data packet MTU peer can receive */
153  bool_t req; /*!< \brief TRUE if indicating a request, else a response. */
154  uint8_t cidLen; /*!< \brief Number of channels in cidList */
155  uint16_t cidList[L2C_MAX_EN_CHAN]; /*!< \brief Local channel ID list */
157 
158 /*! \brief Enhanced connection oriented channel reconfiguration indication structure */
159 typedef struct
160 {
161  wsfMsgHdr_t hdr; /*!< \brief Header structure */
162  uint16_t mps; /*!< \brief Data packet MPS */
163  uint16_t mtu; /*!< \brief Data packet MTU */
164  bool_t req; /*!< \brief TRUE if indicating a request, else a response. */
165  uint8_t cidLen; /*!< \brief Number of channels in cidList */
166  uint16_t cidList[L2C_MAX_EN_CHAN]; /*!< \brief Local channel ID list */
168 
169 /*!
170  * \brief Connection oriented channel event structure
171  *
172  * Connection oriented channel callback header parameters:
173  *
174  * \param hdr.event Callback event
175  * \param hdr.param DM connection ID
176  * \param hdr.status Event status (L2C_COC_DATA_CNF only)
177  */
178 typedef union
179 {
180  wsfMsgHdr_t hdr; /*!< \brief Header structure */
181  l2cCocConnectInd_t connectInd; /*!< \brief Channel connect indication */
182  l2cCocDisconnectInd_t disconnectInd; /*!< \brief Channel disconnect indication */
183  l2cCocDataInd_t dataInd; /*!< \brief Received data indication */
184  l2cCocDataCnf_t dataCnf; /*!< \brief Transmit data confirm */
185  l2cCocEnConnectInd_t enConnectInd; /*!< \brief Enhanced channel connect indication */
186  l2cCocEnReconfigInd_t enReconfigInd; /*!< \brief Enhanced channel reconfigure indication */
187 } l2cCocEvt_t;
188 
189 /*! \brief Configurable parameters */
190 typedef struct
191 {
192  uint16_t reqTimeout; /*!< \brief Request timeout in seconds */
193 } l2cCfg_t;
194 
195 /*! \} */ /* STACK_L2CAP_API */
196 
197 /**************************************************************************************************
198  Global Variables;
199 **************************************************************************************************/
200 
201 /*! \addtogroup STACK_INIT
202  * \{ */
203 
204 /** \name L2CAP Configuration Structure
205  * Pointer to structure containing initialization details of the L2CAP Subsystem. To be configured
206  * by Application.
207  */
208 /**@{*/
209 /*! \brief Configuration pointer */
210 extern l2cCfg_t *pL2cCfg;
211 /**@}*/
212 
213 /*! \} */ /* STACK_INIT */
214 
215 /**************************************************************************************************
216  Callback Function Types
217 **************************************************************************************************/
218 
219 /*! \addtogroup STACK_L2CAP_API
220  * \{ */
221 
222 /*************************************************************************************************/
223 /*!
224  * \brief This callback function sends a received L2CAP packet to the client.
225  *
226  * \param handle The connection handle.
227  * \param len The length of the L2CAP payload data in pPacket.
228  * \param pPacket A buffer containing the packet.
229  *
230  * \return None.
231  */
232 /*************************************************************************************************/
233 typedef void (*l2cDataCback_t)(uint16_t handle, uint16_t len, uint8_t *pPacket);
234 
235 /*************************************************************************************************/
236 /*!
237  * \brief This callback function sends control messages to the client.
238  *
239  * \param pMsg Pointer to message structure.
240  *
241  * \return None.
242  */
243 /*************************************************************************************************/
244 typedef void (*l2cCtrlCback_t)(wsfMsgHdr_t *pMsg);
245 
246 /*************************************************************************************************/
247 /*!
248  * \brief This callback function sends data and other events to connection oriented
249  * channels clients.
250  *
251  * \param pMsg Pointer to message structure.
252  *
253  * \return None.
254  */
255 /*************************************************************************************************/
256 typedef void (*l2cCocCback_t)(l2cCocEvt_t *pMsg);
257 
258 /*************************************************************************************************/
259 /*!
260  * \brief This callback function asks clients of connection oriented channels if a given number
261  * of channels can be created on the PSM.
262  *
263  * \param connId DM connection ID.
264  * \param numChans number of channels requested.
265  *
266  * \return number of channels permitted by client.
267  */
268 /*************************************************************************************************/
269 typedef uint8_t (*l2cCocAcceptCb_t)(dmConnId_t connId, uint8_t numChans);
270 
271 /*************************************************************************************************/
272 /*!
273  * \brief This callback function is used for authoriztion of connection oriented channels.
274  *
275  * \param connId DM connection ID.
276  * \param regId The registration instance requiring authorization.
277  * \param psm The PSM of the registration instance.
278  *
279  * \return L2C_CONN_SUCCESS if authorization is successful, any other value for failure.
280  */
281 /*************************************************************************************************/
282 typedef uint16_t (*l2cCocAuthorCback_t)(dmConnId_t connId, l2cCocRegId_t regId, uint16_t psm);
283 
284 /**************************************************************************************************
285  Function Declarations
286 **************************************************************************************************/
287 
288 /** \name L2CAP Initialization
289  * Initialization and registration functions
290  */
291 /**@{*/
292 
293 /*************************************************************************************************/
294 /*!
295  * \brief Initialize L2C subsystem.
296  *
297  * \return None.
298  */
299 /*************************************************************************************************/
300 void L2cInit(void);
301 
302 /*************************************************************************************************/
303 /*!
304  * \brief Initialize L2C for operation as a Bluetooth LE master.
305  *
306  * \return None.
307  */
308 /*************************************************************************************************/
309 void L2cMasterInit(void);
310 
311 /*************************************************************************************************/
312 /*!
313  * \brief Initialize L2C for operation as a Bluetooth LE slave.
314  *
315  * \return None.
316  */
317 /*************************************************************************************************/
318 void L2cSlaveInit(void);
319 
320 /**@}*/
321 
322 /** \name L2CAP CID Functions
323  * Register and send data over a CID
324  */
325 /**@{*/
326 
327 /*************************************************************************************************/
328 /*!
329  * \brief called by the L2C client, such as ATT or SMP, to register for the given CID.
330  *
331  * \param cid channel identifier.
332  * \param dataCback Callback function for L2CAP data received for this CID.
333  * \param ctrlCback Callback function for control events for this CID.
334  *
335  * \return None.
336  */
337 /*************************************************************************************************/
338 void L2cRegister(uint16_t cid, l2cDataCback_t dataCback, l2cCtrlCback_t ctrlCback);
339 
340 
341 /*************************************************************************************************/
342 /*!
343  * \brief Send an L2CAP data packet on the given CID.
344  *
345  * \param cid The channel identifier.
346  * \param handle The connection handle. The client receives this handle from DM.
347  * \param len The length of the payload data in pPacket.
348  * \param pL2cPacket A buffer containing the packet.
349  *
350  * \return None.
351  */
352 /*************************************************************************************************/
353 void L2cDataReq(uint16_t cid, uint16_t handle, uint16_t len, uint8_t *pL2cPacket);
354 
355 /*************************************************************************************************/
356 /*!
357 * \brief Build and send a signaling packet.
358 *
359 * \param handle The connection handle.
360 * \param code Type of command.
361 * \param len Length of the parameter.
362 * \param pParam parameters of command to send.
363 *
364 * \return None.
365 */
366 /*************************************************************************************************/
367 void L2cDmSigReq(uint16_t handle, uint8_t code, uint16_t len, uint8_t *pParam);
368 
369 /**@}*/
370 
371 /** \name L2CAP COC Functions
372  * Connection Oriented Channels Functions
373  */
374 /**@{*/
375 
376 /*************************************************************************************************/
377 /*!
378  * \brief Initialize L2C connection oriented channel subsystem.
379  *
380  * \return None.
381  */
382 /*************************************************************************************************/
383 void L2cCocInit(void);
384 
385 /*************************************************************************************************/
386 /*!
387  * \brief Register to use a connection oriented channel, as either a channel acceptor,
388  * initiator, or both. If registering as channel acceptor then the PSM is specified.
389  * After registering a connection can be established by the client using this
390  * registration instance.
391  *
392  * \param cback Client callback function.
393  * \param pReg Registration parameter structure.
394  *
395  * \return Registration instance ID or L2C_COC_REG_ID_NONE if registration failed.
396  */
397 /*************************************************************************************************/
398 l2cCocRegId_t L2cCocRegister(l2cCocCback_t cback, l2cCocReg_t *pReg);
399 
400 /*************************************************************************************************/
401 /*!
402  * \brief Deregister and deallocate a connection oriented channel registration instance.
403  * This function should only be called if there are no active channels using this
404  * registration instance.
405  *
406  * \param regId Registration instance ID.
407  *
408  * \return None.
409  */
410 /*************************************************************************************************/
411 void L2cCocDeregister(l2cCocRegId_t regId);
412 
413 /*************************************************************************************************/
414 /*!
415  * \brief Set the channel accept callback.
416  *
417  * \param regId Registration instance ID.
418  * \param cback Client callback function.
419  *
420  * \return None.
421  */
422 /*************************************************************************************************/
423 void L2cCocSetAcceptCback(l2cCocRegId_t regId, l2cCocAcceptCb_t cback);
424 
425 /*************************************************************************************************/
426 /*!
427  * \brief Initiate a connection to the given peer PSM.
428  *
429  * \param connId DM connection ID.
430  * \param regId The associated registration instance.
431  * \param psm Peer PSM.
432  *
433  * \return Local CID or L2C_COC_CID_NONE none if failure.
434  */
435 /*************************************************************************************************/
436 uint16_t L2cCocConnectReq(dmConnId_t connId, l2cCocRegId_t regId, uint16_t psm);
437 
438 /*************************************************************************************************/
439 /*!
440  * \brief Disconnect the channel for the given CID.
441  *
442  * \param cid Channel ID.
443  *
444  * \return None.
445  */
446 /*************************************************************************************************/
447 void L2cCocDisconnectReq(uint16_t cid);
448 
449 /*************************************************************************************************/
450 /*!
451  * \brief Send an L2CAP data packet on the given connection oriented CID.
452  *
453  * \param cid The local channel identifier.
454  * \param len The length of the payload data in pPacket.
455  * \param pPayload Packet payload data.
456  *
457  * \return None.
458  */
459 /*************************************************************************************************/
460 void L2cCocDataReq(uint16_t cid, uint16_t len, uint8_t *pPayload);
461 
462 /*************************************************************************************************/
463 /*!
464  * \brief Send a request to open enhanced credit based channels.
465  *
466  * \param connId DM connection ID.
467  * \param regId The associated registration instance.
468  * \param psm The protocol slave multiplexer.
469  * \param credits The initial number of credits for each CID channel.
470  * \param numChan The number of channels to create - L2C_MAX_EN_CHAN max.
471  *
472  * \return FALSE if unable make request, else TRUE.
473  */
474 /*************************************************************************************************/
475 bool_t L2cCocEnhancedConnectReq(dmConnId_t connId, l2cCocRegId_t regId, uint16_t psm,
476  uint16_t credits, uint8_t numChan);
477 
478 /*************************************************************************************************/
479 /*!
480  * \brief Send a request to reconfigure enhanced credit based channels.
481  *
482  * \param connId DM connection ID.
483  * \param mtu The maximum transmission unit of each source CID channel.
484  * \param mps The maximum payload size on each source CID channel.
485  * \param numChan The number of channels to create (1 to L2C_MAX_EN_CHAN).
486  * \param pChanList A list of local CID to reconfigure (L2C_MAX_EN_CHAN channels, set unused to 0).
487  *
488  * \return FALSE if unable make request, else TRUE.
489  */
490  /*************************************************************************************************/
491 bool_t L2cCocEnhancedReconfigReq(dmConnId_t connId, uint16_t mtu, uint16_t mps,
492  uint8_t numChan, uint16_t *pChanList);
493 
494 /*************************************************************************************************/
495 /*!
496  * \brief For testing purposes only.
497  *
498  * \param result Result code
499  *
500  * \return None.
501  */
502 /*************************************************************************************************/
503 void L2cCocErrorTest(uint16_t result);
504 
505 /*************************************************************************************************/
506 /*!
507  * \brief For testing purposes only.
508  *
509  * \param cid The local channel identifier.
510  * \param credits Credits to send.
511  *
512  * \return None.
513  */
514 /*************************************************************************************************/
515 void L2cCocCreditSendTest(uint16_t cid, uint16_t credits);
516 
517 /**@}*/
518 
519 /** \name L2CAP Connection Parameter Update Functions
520  *
521  */
522 /**@{*/
523 
524 /*************************************************************************************************/
525 /*!
526  * \brief For internal use only. This function is called by DM to send an L2CAP
527  * connection update request.
528  *
529  * \param handle The connection handle.
530  * \param pConnSpec Pointer to the connection specification structure.
531  *
532  * \return None.
533  */
534 /*************************************************************************************************/
535 void L2cDmConnUpdateReq(uint16_t handle, hciConnSpec_t *pConnSpec);
536 
537 /*************************************************************************************************/
538 /*!
539  * \brief For internal use only. This function is called by DM to send an L2CAP
540  * connection update response.
541  *
542  * \param identifier Identifier value previously passed from L2C to DM.
543  * \param handle The connection handle.
544  * \param result Connection update response result.
545  *
546  * \return None.
547  */
548 /*************************************************************************************************/
549 void L2cDmConnUpdateRsp(uint8_t identifier, uint16_t handle, uint16_t result);
550 
551 /**@}*/
552 
553 /*! \} */ /*! STACK_L2CAP_API */
554 
555 #ifdef __cplusplus
556 };
557 #endif
558 
559 #endif /* L2C_API_H */
uint16_t dataLen
packet data length
Definition: l2c_api.h:137
uint16_t cid
Local channel ID.
Definition: l2c_api.h:144
void L2cDataReq(uint16_t cid, uint16_t handle, uint16_t len, uint8_t *pL2cPacket)
Send an L2CAP data packet on the given CID.
wsfMsgHdr_t hdr
Header structure.
Definition: l2c_api.h:134
Connection oriented channel registration structure.
Definition: l2c_api.h:103
void L2cInit(void)
Initialize L2C subsystem.
wsfMsgHdr_t hdr
Header structure.
Definition: l2c_api.h:143
uint8_t dmConnId_t
Connection identifier.
Definition: dm_api.h:588
Received data indication.
Definition: l2c_api.h:88
void(* l2cCocCback_t)(l2cCocEvt_t *pMsg)
This callback function sends data and other events to connection oriented channels clients...
Definition: l2c_api.h:256
uint16_t cid
Local channel ID.
Definition: l2c_api.h:127
void L2cCocDataReq(uint16_t cid, uint16_t len, uint8_t *pPayload)
Send an L2CAP data packet on the given connection oriented CID.
uint16_t psm
Connected PSM.
Definition: l2c_api.h:120
void L2cCocCreditSendTest(uint16_t cid, uint16_t credits)
For testing purposes only.
uint16_t mps
Maximum receive PDU fragment size.
Definition: l2c_api.h:106
void L2cDmConnUpdateRsp(uint8_t identifier, uint16_t handle, uint16_t result)
For internal use only. This function is called by DM to send an L2CAP connection update response...
void L2cCocDisconnectReq(uint16_t cid)
Disconnect the channel for the given CID.
uint16_t cid
Local channel ID.
Definition: l2c_api.h:118
void(* l2cDataCback_t)(uint16_t handle, uint16_t len, uint8_t *pPacket)
This callback function sends a received L2CAP packet to the client.
Definition: l2c_api.h:233
bool_t authoriz
TRUE if authorization is required.
Definition: l2c_api.h:109
uint16_t L2cCocConnectReq(dmConnId_t connId, l2cCocRegId_t regId, uint16_t psm)
Initiate a connection to the given peer PSM.
l2cCocConnectInd_t connectInd
Channel connect indication.
Definition: l2c_api.h:181
uint8_t role
Channel initiator/acceptor role.
Definition: l2c_api.h:111
uint16_t(* l2cCocAuthorCback_t)(dmConnId_t connId, l2cCocRegId_t regId, uint16_t psm)
This callback function is used for authoriztion of connection oriented channels.
Definition: l2c_api.h:282
bool_t req
TRUE if indicating a request, else a response.
Definition: l2c_api.h:164
#define L2C_MAX_EN_CHAN
Max number of channels per enhanced connection request.
Definition: l2c_defs.h:49
wsfMsgHdr_t hdr
Header structure.
Definition: l2c_api.h:150
Connection oriented channel disconnect indication structure.
Definition: l2c_api.h:124
bool_t L2cCocEnhancedConnectReq(dmConnId_t connId, l2cCocRegId_t regId, uint16_t psm, uint16_t credits, uint8_t numChan)
Send a request to open enhanced credit based channels.
Connection oriented channel connect indication structure.
Definition: l2c_api.h:115
void L2cDmSigReq(uint16_t handle, uint8_t code, uint16_t len, uint8_t *pParam)
Build and send a signaling packet.
L2C callback event starting value.
Definition: l2c_api.h:84
uint8_t cidLen
Number of channels in cidList.
Definition: l2c_api.h:165
uint16_t reqTimeout
Request timeout in seconds.
Definition: l2c_api.h:192
uint8_t(* l2cCocAcceptCb_t)(dmConnId_t connId, uint8_t numChans)
This callback function asks clients of connection oriented channels if a given number of channels can...
Definition: l2c_api.h:269
Connection oriented channel event structure.
Definition: l2c_api.h:178
Transmit data confirm.
Definition: l2c_api.h:89
uint8_t * pData
Pointer to packet data.
Definition: l2c_api.h:136
Channel disconnect indication.
Definition: l2c_api.h:85
bool_t L2cCocEnhancedReconfigReq(dmConnId_t connId, uint16_t mtu, uint16_t mps, uint8_t numChan, uint16_t *pChanList)
Send a request to reconfigure enhanced credit based channels.
L2CAP constants and definitions from the Bluetooth specification.
void L2cCocInit(void)
Initialize L2C connection oriented channel subsystem.
Configurable parameters.
Definition: l2c_api.h:190
l2cCocRegId_t L2cCocRegister(l2cCocCback_t cback, l2cCocReg_t *pReg)
Register to use a connection oriented channel, as either a channel acceptor, initiator, or both. If registering as channel acceptor then the PSM is specified. After registering a connection can be established by the client using this registration instance.
uint8_t secLevel
Channel minimum security level requirements.
Definition: l2c_api.h:110
void(* l2cCtrlCback_t)(wsfMsgHdr_t *pMsg)
This callback function sends control messages to the client.
Definition: l2c_api.h:244
Connection specification type.
Definition: hci_api.h:1023
uint16_t l2cCocRegId_t
Connection oriented channel registration ID.
Definition: l2c_api.h:100
Enhanced connection oriented channel reconfiguration indication structure.
Definition: l2c_api.h:159
void L2cCocSetAcceptCback(l2cCocRegId_t regId, l2cCocAcceptCb_t cback)
Set the channel accept callback.
void L2cSlaveInit(void)
Initialize L2C for operation as a Bluetooth LE slave.
Connection oriented channel data indication structure.
Definition: l2c_api.h:132
bool_t req
TRUE if indicating a request, else a response.
Definition: l2c_api.h:153
uint16_t mtu
Data packet MTU.
Definition: l2c_api.h:163
uint16_t peerMtu
Data packet MTU peer can receive.
Definition: l2c_api.h:119
void L2cCocErrorTest(uint16_t result)
For testing purposes only.
Device Manager subsystem API.
uint16_t psm
Protocol service multiplexer.
Definition: l2c_api.h:105
wsfMsgHdr_t hdr
Header structure.
Definition: l2c_api.h:180
void L2cRegister(uint16_t cid, l2cDataCback_t dataCback, l2cCtrlCback_t ctrlCback)
called by the L2C client, such as ATT or SMP, to register for the given CID.
l2cCocDataCnf_t dataCnf
Transmit data confirm.
Definition: l2c_api.h:184
wsfMsgHdr_t hdr
Header structure.
Definition: l2c_api.h:161
Connection oriented channel disconnect indication structure.
Definition: l2c_api.h:141
l2cCocDataInd_t dataInd
Received data indication.
Definition: l2c_api.h:183
uint16_t credits
Data packet receive credits for this channel.
Definition: l2c_api.h:108
uint16_t mtu
Maximum receive data packet size.
Definition: l2c_api.h:107
l2cCocEnReconfigInd_t enReconfigInd
Enhanced channel reconfigure indication.
Definition: l2c_api.h:186
wsfMsgHdr_t hdr
Header structure.
Definition: l2c_api.h:126
void L2cDmConnUpdateReq(uint16_t handle, hciConnSpec_t *pConnSpec)
For internal use only. This function is called by DM to send an L2CAP connection update request...
uint16_t result
Connection failure result code.
Definition: l2c_api.h:128
Enhanced connection oriented channel connect indication structure.
Definition: l2c_api.h:148
uint16_t mps
Data packet MPS peer can receive.
Definition: l2c_api.h:151
l2cCocDisconnectInd_t disconnectInd
Channel disconnect indication.
Definition: l2c_api.h:182
void L2cCocDeregister(l2cCocRegId_t regId)
Deregister and deallocate a connection oriented channel registration instance. This function should o...
Received enhanced reconfiguration indication.
Definition: l2c_api.h:87
l2cCocEnConnectInd_t enConnectInd
Enhanced channel connect indication.
Definition: l2c_api.h:185
void L2cMasterInit(void)
Initialize L2C for operation as a Bluetooth LE master.
Received enhanced connection indication.
Definition: l2c_api.h:86
uint16_t cid
Local channel ID.
Definition: l2c_api.h:135
Common message structure passed to event handler.
Definition: wsf_os.h:106
#define L2C_COC_CBACK_START
L2C callback event starting value.
Definition: l2c_api.h:80
wsfMsgHdr_t hdr
Header structure.
Definition: l2c_api.h:117
uint8_t cidLen
Number of channels in cidList.
Definition: l2c_api.h:154
l2cCfg_t * pL2cCfg
Configuration pointer.
uint16_t mps
Data packet MPS.
Definition: l2c_api.h:162
uint16_t mtu
Data packet MTU peer can receive.
Definition: l2c_api.h:152
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.