TI BLE5-Stack API Documentation  2.02.09.00
l2cap.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  Group: WCS, BTS
4  $Target Device: DEVICES $
5 
6  ******************************************************************************
7  $License: TI_TEXT 2009 $
8  ******************************************************************************
9  $Release Name: PACKAGE NAME $
10  $Release Date: PACKAGE RELEASE DATE $
11  *****************************************************************************/
12 
21 #ifndef L2CAP_H
22 #define L2CAP_H
23 
24 #ifdef __cplusplus
25 extern "C"
26 {
27 #endif
28 
29 /*********************************************************************
30  * INCLUDES
31  */
32 #include "bcomdef.h"
33 #include "osal.h"
34 
35 /*********************************************************************
36  * CONSTANTS
37  */
38 
44 #define L2CAP_MTU_SIZE 23
45 
46 #define L2CAP_SDU_SIZE 65527
47 
48 #define L2CAP_NUM_PSM_DEFAULT 3
49 
50 #define L2CAP_NUM_CO_CHANNELS_DEFAULT 3
51 
52 #define L2CAP_SIG_MTU_SIZE 23
53 
54 #define L2CAP_HDR_SIZE 4
55 
56 #define L2CAP_MAX_NOF_CREDITS 0xFFFF
57 
58 #define L2CAP_LEN_FIELD_SIZE 2
59 
60 
68 #define L2CAP_INVALID_PSM 0x0000
69 
70 #define L2CAP_FIXED_PSM_MIN 0x0001
71 #define L2CAP_FIXED_PSM_MAX 0x007F
72 
73 #define L2CAP_DYNAMIC_PSM_MIN 0x0080
74 #define L2CAP_DYNAMIC_PSM_MAX 0x00FF
75 
76 
85 #define L2CAP_CID_NULL 0x0000
86 
87 #define L2CAP_CID_ATT 0x0004
88 #define L2CAP_CID_SIG 0x0005
89 #define L2CAP_CID_SMP 0x0006
90 #define L2CAP_CID_GENERIC 0x0007
91 
92 #define L2CAP_DYNAMIC_CID_MIN 0x0040
93 #define L2CAP_DYNAMIC_CID_MAX 0x007F
94 
95 #define L2CAP_NUM_FIXED_CHANNELS 4
96 
97 #define L2CAP_NUM_SIG_COMMANDS 1
98 
99 
109 #define L2CAP_RTX_TIMEOUT 30
110 
115 #define L2CAP_CMD_REJECT 0x01
116 #define L2CAP_DISCONNECT_REQ 0x06
117 #define L2CAP_DISCONNECT_RSP 0x07
118 #define L2CAP_INFO_REQ 0x0a
119 #define L2CAP_INFO_RSP 0x0b
120 #define L2CAP_PARAM_UPDATE_REQ 0x12
121 #define L2CAP_PARAM_UPDATE_RSP 0x13
122 #define L2CAP_CONNECT_IND 0x14
123 #define L2CAP_CONNECT_RSP 0x15
124 #define L2CAP_FLOW_CTRL_CREDIT 0x16
125 
126 
133 #define L2CAP_CHANNEL_ESTABLISHED_EVT 0x60
134 #define L2CAP_CHANNEL_TERMINATED_EVT 0x61
135 #define L2CAP_OUT_OF_CREDIT_EVT 0x62
136 #define L2CAP_PEER_CREDIT_THRESHOLD_EVT 0x63
137 #define L2CAP_SEND_SDU_DONE_EVT 0x64
138 #define L2CAP_NUM_CTRL_DATA_PKT_EVT 0x65
139 
140 
147 #define L2CAP_REJECT_CMD_NOT_UNDERSTOOD 0x0000
148 #define L2CAP_REJECT_SIGNAL_MTU_EXCEED 0x0001
149 #define L2CAP_REJECT_INVALID_CID 0x0002
150 
151 
158 #define L2CAP_CONN_SUCCESS 0x0000
159 #define L2CAP_CONN_PSM_NOT_SUPPORTED 0x0002
160 #define L2CAP_CONN_NO_RESOURCES 0x0004
161 #define L2CAP_CONN_INSUFFICIENT_AUTHEN 0x0005
162 #define L2CAP_CONN_INSUFFICIENT_AUTHOR 0x0006
163 #define L2CAP_CONN_INSUFFICIENT_KEY_SIZE 0x0007
164 #define L2CAP_CONN_INSUFFICIENT_ENCRYPT 0x0008
165 #define L2CAP_CONN_INVALID_SRC_CID 0x0009
166 #define L2CAP_CONN_SRC_CID_ALREADY_ALLOC 0x000A
167 #define L2CAP_CONN_UNACCEPTABLE_PARAMS 0x000B
168 
169 #define L2CAP_CONN_PENDING_SEC_VERIFY 0xFFFF
170 
171 
178 #define L2CAP_CONN_PARAMS_ACCEPTED 0x0000
179 #define L2CAP_CONN_PARAMS_REJECTED 0x0001
180 
181 
188 #define L2CAP_TERM_LINK_DOWN 0x0000
189 #define L2CAP_TERM_BY_PSM 0x0001
190 #define L2CAP_TERM_BY_PEER_PSM 0x0002
191 #define L2CAP_TERM_MAX_CREDIT_EXCEED 0x0003
192 #define L2CAP_TERM_SDU_LEN_EXCEED 0x0004
193 #define L2CAP_TERM_PSM_MTU_EXCEED 0x0005
194 #define L2CAP_TERM_RX_PKT_NO_CREDIT 0x0006
195 #define L2CAP_TERM_RX_ERROR 0x0007
196 #define L2CAP_TERM_TX_ERROR 0x0008
197 #define L2CAP_TERM_MEM_ALLOC_ERROR 0x0009
198 
199 
206 #define L2CAP_CLOSED 0x00
207 #define L2CAP_OPEN 0x01
208 #define L2CAP_PENDING_CONN_RSP 0x02
209 #define L2CAP_PENDING_DISCONN_RSP 0x03
210 #define L2CAP_PENDING_PARAM_UPDATE_RSP 0x04
211 #define L2CAP_PENDING_INFO_RSP 0x05
212 #define L2CAP_PENDING_SEC_VERIFY 0x06
213 
214 
221 #define L2CAP_INFO_CONNLESS_MTU 0x0001
222 #define L2CAP_INFO_EXTENDED_FEATURES 0x0002
223 #define L2CAP_INFO_FIXED_CHANNELS 0x0003
224 
225 
227 /*********************************************************************
228  * Information Response: Extended Features Mask Values
229  */
230 #define L2CAP_FIXED_CHANNELS 0x00000080
231 
232 #define L2CAP_EXTENDED_FEATURES_SIZE 4
233 
234 /*********************************************************************
235  * Information Response: Fixed Channels Mask Values
236  */
237 #define L2CAP_FIXED_CHANNELS_ATT 0x10
238 
239 #define L2CAP_FIXED_CHANNELS_SIG 0x20
240 
241 #define L2CAP_FIXED_CHANNELS_SMP 0x40
242 
243 #define L2CAP_FIXED_CHANNELS_SIZE 8
244 
245 /*********************************************************************
246  * Information Response: Result Values
247  */
248 #define L2CAP_INFO_SUCCESS 0x0000
249 
250 #define L2CAP_INFO_NOT_SUPPORTED 0x0001
251 
252 
254 /*********************************************************************
255  * L2CAP Test Modes: Test code values
256  */
257 #if defined ( TESTMODES )
258  // Test modes 0 through 10 are reserved for L2CAP Connection Request.
259  #define L2CAP_TESTMODE_OFF 0
260  #define L2CAP_TESTMODE_PSM_NOT_SUPPORTED 2
261  #define L2CAP_TESTMODE_NO_RESOURCES 4
262  #define L2CAP_TESTMODE_INSUFF_AUTHEN 5
263  #define L2CAP_TESTMODE_INSUFF_AUTHOR 6
264  #define L2CAP_TESTMODE_INSUFF_KEY_SIZE 7
265  #define L2CAP_TESTMODE_INSUFF_ENCRYPT 8
266  #define L2CAP_TESTMODE_INVALID_SRC_CID 9
267  #define L2CAP_TESTMODE_SRC_CID_ALREADY_ALLOC 10
268  #define L2CAP_TESTMODE_OUT_OF_RANGE_CREDITS 11
269  #define L2CAP_TESTMODE_SDU_LEN_EXCEED 12
270  #define L2CAP_TESTMODE_TX_PKT_NO_CREDIT 13
271  #define L2CAP_TESTMODE_BLOCK_DATA_TX 14
272 #endif
273 
275 
278 /*********************************************************************
279  * MACROS
280  */
281 
282 /*********************************************************************
283  * TYPEDEFS
284  */
285 
291 typedef struct
293 {
294  uint8 maxNumPSM;
297 
299 typedef struct
300 {
301  uint16 localCID;
302  uint16 remoteCID;
304 
306 typedef union
307 {
308  uint16 signalMTU;
311 
313 typedef struct
314 {
315  uint16 reason;
317 
318  // Shorthand access for union members
319  #define maxSignalMTU reasonData.signalMTU
320  #define invalidLocalCID reasonData.invalidCID.localCID
321  #define invalidRemoteCID reasonData.invalidCID.remoteCID
322 } l2capCmdReject_t;
323 
325 typedef struct
326 {
327  uint16 intervalMin;
328  uint16 intervalMax;
329  uint16 slaveLatency;
332 
334 typedef struct
335 {
336  uint16 result;
338 
340 typedef struct
341 {
342  uint16 infoType;
344 
346 typedef union
347 {
350  uint8 fixedChannels[L2CAP_FIXED_CHANNELS_SIZE];
351 } l2capInfo_t;
352 
354 typedef struct
355 {
356  uint16 result;
357  uint16 infoType;
360 
362 typedef struct
363 {
364  uint16 psm;
365  uint16 srcCID;
366  uint16 mtu;
367  uint16 mps;
368  uint16 initCredits;
370 
372 typedef struct
373 {
374  uint16 dstCID;
375  uint16 mtu;
376  uint16 mps;
377  uint16 initCredits;
378  uint16 result;
380 
382 typedef struct
383 {
384  uint16 dstCID;
385  uint16 srcCID;
387 
389 typedef struct
390 {
391  uint16 dstCID;
392  uint16 srcCID;
394 
396 typedef struct
397 {
398  uint16 CID;
399  uint16 credits;
401 
403 typedef struct
404 {
405  uint16 mtu;
406  uint16 mps;
412 
414 typedef struct
415 {
416  uint16 psm;
417  uint16 mtu;
418  uint16 mps;
419  uint16 credits;
420  uint16 peerCID;
421  uint16 peerMtu;
422  uint16 peerMps;
423  uint16 peerCredits;
426 
428 typedef struct
429 {
430  uint8 state;
433 
447 typedef struct
448 {
449  uint16 result;
450  uint16 CID;
453 
460 typedef struct
461 {
462  uint16 CID;
463  uint16 peerCID;
464  uint16 reason;
466 
473 typedef struct
474 {
475  uint16 CID;
476  uint16 peerCID;
477  uint16 credits;
480 
487 typedef struct
488 {
489  uint16 CID;
490  uint16 credits;
491  uint16 peerCID;
492  uint16 peerCredits;
493  uint16 totalLen;
494  uint16 txLen;
496 
503 typedef struct
504 {
505  uint8 numDataPkt;
507 
509 typedef union
510 {
511  // Requests
517 
518  // Responses
524 
525  // Proprietary local events
532 
539 typedef struct
540 {
542  uint16 connHandle;
543  uint8 id;
544  uint8 opcode;
547 
549 typedef struct
550 {
551  uint16 CID;
552  uint8 *pPayload;
553  uint16 len;
556 } l2capPacket_t;
557 
568 typedef struct
569 {
571  uint16 connHandle;
574 
596 typedef uint16 (*pfnVerifySecCB_t)( uint16 connHandle, uint8 id, l2capConnectReq_t *pReq );
597 
605 typedef struct
607 {
608  uint16 psm;
609  uint16 mtu;
613  uint8 taskId;
615 } l2capPsm_t;
616  // end of L2CAP_Structs
618 
619 /*********************************************************************
620  * GLOBAL VARIABLES
621  */
622 
623 /*********************************************************************
624  * FUNCTIONS
625  */
626 
636 extern bStatus_t L2CAP_RegisterApp( uint8 taskId, uint16 CID );
637 
644 extern void L2CAP_RegisterFlowCtrlTask( uint8 taskId );
645 
669 extern bStatus_t L2CAP_SendData( uint16 connHandle, l2capPacket_t *pPkt );
670 
683 extern bStatus_t L2CAP_RegisterPsm( l2capPsm_t *pPsm );
684 
695 extern bStatus_t L2CAP_DeregisterPsm( uint8 taskId, uint16 psm );
696 
706 extern bStatus_t L2CAP_PsmInfo( uint16 psm, l2capPsmInfo_t *pInfo );
707 
718 extern bStatus_t L2CAP_PsmChannels( uint16 psm, uint8 numCIDs, uint16 *pCIDs );
719 
729 extern bStatus_t L2CAP_ChannelInfo( uint16 CID, l2capChannelInfo_t *pInfo );
730 
746 extern bStatus_t L2CAP_ConnectReq( uint16 connHandle, uint16 psm, uint16 peerPsm );
747 
761 extern bStatus_t L2CAP_ConnectRsp( uint16 connHandle, uint8 id, uint16 result );
762 
775 extern bStatus_t L2CAP_DisconnectReq( uint16 CID );
776 
790 extern bStatus_t L2CAP_FlowCtrlCredit( uint16 CID, uint16 peerCredits );
791 
807 extern bStatus_t L2CAP_SendSDU( l2capPacket_t *pPkt );
808 
822 extern bStatus_t L2CAP_CmdReject( uint16 connHandle, uint8 id, l2capCmdReject_t *pCmdReject );
823 
838 extern bStatus_t L2CAP_InfoReq( uint16 connHandle, l2capInfoReq_t *pInfoReq, uint8 taskId );
839 
855 extern bStatus_t L2CAP_ConnParamUpdateReq( uint16 connHandle, l2capParamUpdateReq_t *pUpdateReq, uint8 taskId );
856 
870 extern bStatus_t L2CAP_ConnParamUpdateRsp( uint16 connHandle, uint8 id, l2capParamUpdateRsp_t *pUpdateRsp );
871 
880 extern void L2CAP_SetUserConfig( l2capUserCfg_t *pUserCfg );
881 
890 extern void L2CAP_SetBufSize( uint16 dataPktLen, uint8 numDataPkts );
891 
897 extern uint16 L2CAP_GetMTU( void );
898 
911 extern void *L2CAP_bm_alloc( uint16 size );
912 
921 extern uint16 L2CAP_BuildConnectReq( uint8 *pBuf, uint8 *pData );
922 
933 extern bStatus_t L2CAP_ParseConnectReq( l2capSignalCmd_t *pCmd, uint8 *pData, uint16 len );
934 
945 extern bStatus_t L2CAP_ParseFlowCtrlCredit( l2capSignalCmd_t *pCmd, uint8 *pData, uint16 len );
946 
955 extern uint16 L2CAP_BuildCmdReject( uint8 *pBuf, uint8 *pCmd );
956 
967 extern bStatus_t L2CAP_ParseInfoReq( l2capSignalCmd_t *pCmd, uint8 *pData, uint16 len );
968 
979 extern bStatus_t L2CAP_ParseParamUpdateReq( l2capSignalCmd_t *pCmd, uint8 *pData, uint16 len );
980 
989 extern uint16 L2CAP_BuildParamUpdateRsp( uint8 *pBuf, uint8 *pData );
990 
999 extern uint16 L2CAP_BuildInfoRsp( uint8 *pBuf, uint8 *pData );
1000 
1008 extern void L2CAP_SetControllerToHostFlowCtrl( uint16 hostBuffSize, uint8 flowCtrlMode );
1009 
1020 extern void L2CAP_HostNumCompletedPkts( uint16 connHandle, uint16 numCompletedPkts );
1021 
1029 extern void L2CAP_SetParamValue( uint16 value );
1030 
1036 extern uint16 L2CAP_GetParamValue( void );
1037 
1038 /*-------------------------------------------------------------------
1039  * TASK API - These functions must only be called by OSAL.
1040  */
1041 
1043 
1051 extern void L2CAP_Init( uint8 taskId );
1052 
1062 extern uint16 L2CAP_ProcessEvent( uint8 taskId, uint16 events );
1063 
1065 
1066 /*********************************************************************
1067 *********************************************************************/
1068 
1069 #ifdef __cplusplus
1070 }
1071 #endif
1072 
1073 #endif /* L2CAP_H */
1074 
uint8 numActiveChannels
Number of active CO Channels.
Definition: l2cap.h:410
uint16 remoteCID
Source CID from the rejected command.
Definition: l2cap.h:302
Local channel information format.
Definition: l2cap.h:428
uint16 peerCreditThreshold
Low threshold for number of peer credits.
Definition: l2cap.h:408
This API allows the software components in the Z-Stack to be written independently of the specifics o...
osal_event_hdr_t hdr
L2CAP_DATA_EVENT and status.
Definition: l2cap.h:570
l2capConnectRsp_t connectRsp
LE Credit Based Connection Response.
Definition: l2cap.h:522
uint16 intervalMin
Minimum Interval.
Definition: l2cap.h:327
uint16(* pfnVerifySecCB_t)(uint16 connHandle, uint8 id, l2capConnectReq_t *pReq)
Callback function prototype to verify security when a Connection Request is received.
Definition: l2cap.h:596
Command Reject format.
Definition: l2cap.h:313
bStatus_t L2CAP_ConnParamUpdateRsp(uint16 connHandle, uint8 id, l2capParamUpdateRsp_t *pUpdateRsp)
Send Connection Parameter Update Response.
uint16 CID
Local channel id.
Definition: l2cap.h:489
uint16 CID
local channel id
Definition: l2cap.h:551
uint16 initCredits
Indicates number of LE-frames that peer device can send.
Definition: l2cap.h:377
Command Reject Reason Data format.
Definition: l2cap.h:306
l2capParamUpdateReq_t updateReq
Connection Parameter Update Request.
Definition: l2cap.h:512
uint8 maxNumCoChannels
Max number of Connection Oriented Channels: L2CAP_NUM_CO_CHANNELS_DEFAULT.
Definition: l2cap.h:295
Information Response Data field.
Definition: l2cap.h:346
uint16 totalLen
Total length of SDU being transmitted.
Definition: l2cap.h:493
uint16 localCID
Destination CID from the rejected command.
Definition: l2cap.h:301
bStatus_t L2CAP_RegisterPsm(l2capPsm_t *pPsm)
Register a Protocol/Service Multiplexer (PSM) with L2CAP.
uint16 mps
Specifies maximum payload size that can be received on this channel.
Definition: l2cap.h:367
uint16 L2CAP_GetMTU(void)
Get the maximum payload size that L2CAP is capable of receiving.
#define L2CAP_FIXED_CHANNELS_SIZE
Length of Fixed Channels bit mask.
Definition: l2cap.h:243
uint16 initPeerCredits
Number of LE-frames that peer device can send.
Definition: l2cap.h:407
Connection oriented channel information format.
Definition: l2cap.h:414
uint16 result
Result.
Definition: l2cap.h:356
uint16 result
Indicates outcome of connection request: L2CAP Connection Response Result Values. ...
Definition: l2cap.h:378
Disconnection Response format (src/dst CIDs are relative to sender of request).
Definition: l2cap.h:389
uint16 mtu
Maximum SDU size that can be received by local device.
Definition: l2cap.h:609
void L2CAP_RegisterFlowCtrlTask(uint8 taskId)
Register task to recevie L2CAP Flow Control events when there are data buffers available for sending ...
uint16 peerCreditThreshold
Low threshold for peer credit count.
Definition: l2cap.h:424
uint16 peerMps
Maximum payload size that can be received by peer device.
Definition: l2cap.h:422
Disconnection Request format (src/dst CIDs are relative to sender of request).
Definition: l2cap.h:382
l2capNumCtrlDataPktEvt_t numCtrlDataPktEvt
Number of Available Ctrl Data Packets Event.
Definition: l2cap.h:530
bStatus_t L2CAP_RegisterApp(uint8 taskId, uint16 CID)
Register a protocol/application with an L2CAP fixed channel.
uint16 dstCID
Identifies CID on device sending response.
Definition: l2cap.h:391
l2capInfoRsp_t infoRsp
Information Response - not supported.
Definition: l2cap.h:520
bStatus_t L2CAP_ConnectRsp(uint16 connHandle, uint8 id, uint16 result)
Send Connection Response.
uint16 infoType
Information type: L2CAP Information Request/Response Info Types.
Definition: l2cap.h:342
uint16 connectionlessMTU
Connectionless MTU.
Definition: l2cap.h:348
uint16 L2CAP_BuildConnectReq(uint8 *pBuf, uint8 *pData)
Build Connection Request.
uint16 psm
LE PSM.
Definition: l2cap.h:364
uint16 peerCID
Remote channel id.
Definition: l2cap.h:420
osal_event_hdr_t hdr
L2CAP_SIGNAL_EVENT and status.
Definition: l2cap.h:541
l2capReasonData_t reasonData
Reason Data.
Definition: l2cap.h:316
void L2CAP_SetUserConfig(l2capUserCfg_t *pUserCfg)
Set the user configurable variables for the L2CAP layer.
uint16 CID
Local channel id.
Definition: l2cap.h:462
bStatus_t L2CAP_PsmChannels(uint16 psm, uint8 numCIDs, uint16 *pCIDs)
Get all active channels for a given registered PSM.
uint16 srcCID
Specifies CID to be disconnected on device sending request.
Definition: l2cap.h:385
uint16 CID
Represents Source CID of device sending credit packet.
Definition: l2cap.h:398
uint8 maxNumPSM
Max number of Protocol/Service Multiplexers (PSM): L2CAP_NUM_PSM_DEFAULT.
Definition: l2cap.h:294
uint16 peerCID
Peer channel id.
Definition: l2cap.h:491
uint16 mtu
Specifies maximum SDU size that can be received on this channel.
Definition: l2cap.h:375
uint8 * pPayload
Definition: l2cap.h:552
uint8 state
Channel connection state: L2CAP Channel States.
Definition: l2cap.h:430
uint16 txLen
Total number of octets transmitted.
Definition: l2cap.h:494
uint16 reason
Indicates reason for termination: L2CAP Channel Terminated Event Reason Values.
Definition: l2cap.h:464
uint8 taskId
Task registered with PSM.
Definition: l2cap.h:613
L2CAP PSM structure. Allocated one for each registered PSM.
Definition: l2cap.h:606
l2capInfo_t info
Content of Info field depends on infoType.
Definition: l2cap.h:358
uint16 L2CAP_BuildInfoRsp(uint8 *pBuf, uint8 *pData)
Build Information Response.
bStatus_t L2CAP_InfoReq(uint16 connHandle, l2capInfoReq_t *pInfoReq, uint8 taskId)
Send Information Request.
bStatus_t L2CAP_DisconnectReq(uint16 CID)
Send Disconnection Request.
uint8 id
identifier to match responses with requests
Definition: l2cap.h:543
void L2CAP_HostNumCompletedPkts(uint16 connHandle, uint16 numCompletedPkts)
Host Number of Completed Packets.
L2CAP_CHANNEL_TERMINATED_EVT message format.
Definition: l2cap.h:460
uint16 mps
Maximum payload size that can be received by local device.
Definition: l2cap.h:406
PSM information format.
Definition: l2cap.h:403
uint16 result
Result: L2CAP Connection Parameter Update Response Result Values.
Definition: l2cap.h:336
Union of all L2CAP Signaling commands.
Definition: l2cap.h:509
uint8 numDataPkt
Number of Data Packets Available.
Definition: l2cap.h:505
uint16 srcCID
Represents CID on device sending request and receiving response.
Definition: l2cap.h:365
l2capDisconnectReq_t disconnectReq
Disconnection Request.
Definition: l2cap.h:515
uint16 peerCreditThreshold
Low threshold for peer credit count.
Definition: l2cap.h:611
Connection Request format.
Definition: l2cap.h:362
uint16 signalMTU
Maximum Signaling MTU.
Definition: l2cap.h:308
uint16 peerCredits
Peer credits.
Definition: l2cap.h:492
L2CAP_OUT_OF_CREDIT_EVT or L2CAP_PEER_CREDIT_THRESHOLD_EVT message format.
Definition: l2cap.h:473
uint16 initCredits
Indicates number of LE-frames that peer device can send.
Definition: l2cap.h:368
Invalid CID in Request format.
Definition: l2cap.h:299
uint8 maxNumChannels
Maximum number of CO Channels supported by PSM.
Definition: l2cap.h:409
pfnVerifySecCB_t pfnVerifySecCB
PSM security verification callback (can be NULL)
Definition: l2cap.h:614
bStatus_t L2CAP_ConnectReq(uint16 connHandle, uint16 psm, uint16 peerPsm)
Send Connection Request.
bStatus_t L2CAP_ParseConnectReq(l2capSignalCmd_t *pCmd, uint8 *pData, uint16 len)
Parse Connection Request message.
uint16 peerCredits
Number of LE-frames that peer device can send.
Definition: l2cap.h:423
uint16 connHandle
connection packet was received on
Definition: l2cap.h:571
uint32 extendedFeatures
Extended features supported.
Definition: l2cap.h:349
uint16 peerMtu
Maximum SDU size that can be received by peer device.
Definition: l2cap.h:421
l2capSignalCmd_t cmd
command data
Definition: l2cap.h:545
l2capParamUpdateRsp_t updateRsp
Connection Parameter Update Response.
Definition: l2cap.h:519
L2CAP_CHANNEL_ESTABLISHED_EVT message format.
Definition: l2cap.h:447
l2capSendSduDoneEvt_t sendSduDoneEvt
Send SDU Done Event.
Definition: l2cap.h:529
bStatus_t L2CAP_FlowCtrlCredit(uint16 CID, uint16 peerCredits)
Send Flow Control Credit.
l2capInvalidCID_t invalidCID
Invalid CID in Request.
Definition: l2cap.h:309
bStatus_t L2CAP_SendSDU(l2capPacket_t *pPkt)
Send data packet over an L2CAP connection oriented channel established over a physical connection...
uint8 opcode
type of command: L2CAP Signaling Codes (type of commands)
Definition: l2cap.h:544
L2CAP_NUM_CTRL_DATA_PKT_EVT message format.
Definition: l2cap.h:503
uint16 credits
Definition: l2cap.h:477
Information Response format.
Definition: l2cap.h:354
bStatus_t L2CAP_ParseFlowCtrlCredit(l2capSignalCmd_t *pCmd, uint8 *pData, uint16 len)
Parse Flow Control Credit message.
User configurable variables format.
Definition: l2cap.h:292
Type definitions and macros for BLE stack.
uint16 L2CAP_BuildCmdReject(uint8 *pBuf, uint8 *pCmd)
Build Command Reject.
uint16 dstCID
Represents CID on device receiving request and sending response.
Definition: l2cap.h:374
uint16 mps
Specifies maximum payload size that can be received on this channel.
Definition: l2cap.h:376
Information Request format.
Definition: l2cap.h:340
bStatus_t L2CAP_CmdReject(uint16 connHandle, uint8 id, l2capCmdReject_t *pCmdReject)
Send Command Reject.
uint16 intervalMax
Maximum Interval.
Definition: l2cap.h:328
OSAL Event Header.
Definition: osal.h:92
l2capInfoReq_t infoReq
Information Request - not supported.
Definition: l2cap.h:513
bStatus_t L2CAP_PsmInfo(uint16 psm, l2capPsmInfo_t *pInfo)
Get information about a given registered PSM.
l2capCreditEvt_t creditEvt
Out Of Credit Event or Peer Credit Threshold Event.
Definition: l2cap.h:528
bStatus_t L2CAP_ParseInfoReq(l2capSignalCmd_t *pCmd, uint8 *pData, uint16 len)
Parse Information Request message.
l2capDisconnectRsp_t disconnectRsp
Disconnection Response.
Definition: l2cap.h:523
l2capChannelEstEvt_t channelEstEvt
Channel Established Event.
Definition: l2cap.h:526
void L2CAP_SetBufSize(uint16 dataPktLen, uint8 numDataPkts)
This API is used by the upper layer to set the maximum data packet size and the number of data packet...
uint16 initPeerCredits
Number of LE-frames that peer device can send.
Definition: l2cap.h:610
uint16 slaveLatency
Slave Latency.
Definition: l2cap.h:329
uint16 connHandle
connection message was received on
Definition: l2cap.h:542
L2CAP packet structure.
Definition: l2cap.h:549
OSAL L2CAP_SIGNAL_EVENT message format.
Definition: l2cap.h:539
l2capPacket_t pkt
received packet
Definition: l2cap.h:572
bStatus_t L2CAP_DeregisterPsm(uint8 taskId, uint16 psm)
Deregister a Protocol/Service Multiplexer with L2CAP.
uint16 mtu
Maximum SDU size that can be received by local device.
Definition: l2cap.h:405
uint16 peerCID
Peer channel id.
Definition: l2cap.h:463
uint16 mtu
Maximum SDU size that can be received by local device.
Definition: l2cap.h:417
bStatus_t L2CAP_ConnParamUpdateReq(uint16 connHandle, l2capParamUpdateReq_t *pUpdateReq, uint8 taskId)
Send Connection Parameter Update Request.
uint16 psm
PSM that channel belongs to.
Definition: l2cap.h:416
l2capFlowCtrlCredit_t credit
LE Flow Control Credit.
Definition: l2cap.h:516
uint16 mps
Maximum payload size that can be received by local device.
Definition: l2cap.h:418
uint16 reason
Reason: L2CAP Command Reject Reason Codes.
Definition: l2cap.h:315
Flow Control Credit format.
Definition: l2cap.h:396
uint16 dstCID
Specifies CID to be disconnected on device receiving request.
Definition: l2cap.h:384
l2capCoCInfo_t info
Channel info.
Definition: l2cap.h:431
uint16 credits
Number of LE-frames that local device can send.
Definition: l2cap.h:419
uint16 infoType
Information type: L2CAP Information Request/Response Info Types.
Definition: l2cap.h:357
uint16 credits
Number of LE-frames that can be sent to local device.
Definition: l2cap.h:399
l2capCoCInfo_t info
Channel info.
Definition: l2cap.h:451
uint16 L2CAP_GetParamValue(void)
Get the L2CAP parameter value.
L2CAP_SEND_SDU_DONE_EVT message format.
Definition: l2cap.h:487
void L2CAP_SetControllerToHostFlowCtrl(uint16 hostBuffSize, uint8 flowCtrlMode)
Turn flow control on or off for data packets sent from the Controller to the Host.
Status_t bStatus_t
BLE Generic Status return.
Definition: bcomdef.h:245
uint16 timeoutMultiplier
Timeout Multiplier.
Definition: l2cap.h:330
void L2CAP_SetParamValue(uint16 value)
Set the L2CAP parameter value.
uint16 CID
Local channel id.
Definition: l2cap.h:475
uint16 CID
Local channel id.
Definition: l2cap.h:450
Connection Response format.
Definition: l2cap.h:372
uint16 srcCID
Identifies CID on device receiving response.
Definition: l2cap.h:392
bStatus_t L2CAP_ChannelInfo(uint16 CID, l2capChannelInfo_t *pInfo)
Get information about a given active Connection Oriented Channel.
uint16 L2CAP_BuildParamUpdateRsp(uint8 *pBuf, uint8 *pData)
Build Connection Parameter Update Response.
uint16 psm
Registered PSM.
Definition: l2cap.h:608
l2capChannelTermEvt_t channelTermEvt
Channel Terminated Event.
Definition: l2cap.h:527
void * L2CAP_bm_alloc(uint16 size)
L2CAP implementation of the allocator functionality.
Connection Parameter Update Response format.
Definition: l2cap.h:334
uint16 peerCID
Peer channel id.
Definition: l2cap.h:476
Connection Parameter Update Request format.
Definition: l2cap.h:325
bStatus_t L2CAP_ParseParamUpdateReq(l2capSignalCmd_t *pCmd, uint8 *pData, uint16 len)
Parse Connection Parameter Update Request.
l2capConnectReq_t connectReq
LE Credit Based Connection Request.
Definition: l2cap.h:514
uint16 mtu
Specifies maximum SDU size that can be received on this channel.
Definition: l2cap.h:366
OSAL L2CAP_DATA_EVENT message format.
Definition: l2cap.h:568
uint8 maxNumChannels
Maximum number of CO Channels supported by PSM.
Definition: l2cap.h:612
uint16 result
Indicates outcome of connection request: L2CAP Connection Response Result Values. ...
Definition: l2cap.h:449
l2capCmdReject_t cmdReject
Command Reject.
Definition: l2cap.h:521
bStatus_t L2CAP_SendData(uint16 connHandle, l2capPacket_t *pPkt)
Send data packet over an L2CAP fixed channel established over a physical connection.
uint16 credits
Local credits.
Definition: l2cap.h:490
© Copyright 1995-2024, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale