TI BLE5-Stack API Documentation  9.14.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  */
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 23U
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 // Supported
116 #define L2CAP_CMD_REJECT 0x01
117 #define L2CAP_DISCONNECT_REQ 0x06
118 #define L2CAP_DISCONNECT_RSP 0x07
119 #define L2CAP_CONNECTION_PARAMETER_UPDATE_REQ 0x12
120 #define L2CAP_PARAM_UPDATE_RSP 0x13
121 #define L2CAP_CONNECT_IND 0x14
122 #define L2CAP_CONNECT_RSP 0x15
123 #define L2CAP_FLOW_CTRL_CREDIT 0x16
124 
125 // Not supported
126 #define L2CAP_CONNECTION_REQ 0x02
127 #define L2CAP_CONNECTION_RSP 0x03
128 #define L2CAP_CONFIGURATION_REQ 0x04
129 #define L2CAP_CONFIGURATION_RSP 0x05
130 #define L2CAP_ECHO_REQ 0x08
131 #define L2CAP_ECHO_RSP 0x09
132 #define L2CAP_INFO_REQ 0x0a
133 #define L2CAP_INFO_RSP 0x0b
134 #define L2CAP_CREDIT_BASED_CONNECTION_REQ 0x17
135 #define L2CAP_CREDIT_BASED_CONNECTION_RSP 0x18
136 #define L2CAP_CREDIT_BASED_RECONFIGURE_REQ 0x19
137 #define L2CAP_CREDIT_BASED_RECONFIGURE_RSP 0x1A
138 
139 
146 #define L2CAP_CHANNEL_ESTABLISHED_EVT 0x60
147 #define L2CAP_CHANNEL_TERMINATED_EVT 0x61
148 #define L2CAP_OUT_OF_CREDIT_EVT 0x62
149 #define L2CAP_PEER_CREDIT_THRESHOLD_EVT 0x63
150 #define L2CAP_SEND_SDU_DONE_EVT 0x64
151 #define L2CAP_NUM_CTRL_DATA_PKT_EVT 0x65
152 #define L2CAP_PEER_CREDIT_RECEIVED_EVT 0x66
153 
154 
161 #define L2CAP_REJECT_CMD_NOT_UNDERSTOOD 0x0000
162 #define L2CAP_REJECT_SIGNAL_MTU_EXCEED 0x0001
163 #define L2CAP_REJECT_INVALID_CID 0x0002
164 
165 
172 #define L2CAP_CONN_SUCCESS 0x0000
173 #define L2CAP_CONN_PSM_NOT_SUPPORTED 0x0002
174 #define L2CAP_CONN_NO_RESOURCES 0x0004
175 #define L2CAP_CONN_INSUFFICIENT_AUTHEN 0x0005
176 #define L2CAP_CONN_INSUFFICIENT_AUTHOR 0x0006
177 #define L2CAP_CONN_INSUFFICIENT_KEY_SIZE 0x0007
178 #define L2CAP_CONN_INSUFFICIENT_ENCRYPT 0x0008
179 #define L2CAP_CONN_INVALID_SRC_CID 0x0009
180 #define L2CAP_CONN_SRC_CID_ALREADY_ALLOC 0x000A
181 #define L2CAP_CONN_UNACCEPTABLE_PARAMS 0x000B
182 
183 #define L2CAP_CONN_PENDING_SEC_VERIFY 0xFFFF
184 
185 
192 #define L2CAP_CONN_PARAMS_ACCEPTED 0x0000
193 #define L2CAP_CONN_PARAMS_REJECTED 0x0001
194 
195 
202 #define L2CAP_TERM_LINK_DOWN 0x0000
203 #define L2CAP_TERM_BY_PSM 0x0001
204 #define L2CAP_TERM_BY_PEER_PSM 0x0002
205 #define L2CAP_TERM_MAX_CREDIT_EXCEED 0x0003
206 #define L2CAP_TERM_SDU_LEN_EXCEED 0x0004
207 #define L2CAP_TERM_PSM_MTU_EXCEED 0x0005
208 #define L2CAP_TERM_RX_PKT_NO_CREDIT 0x0006
209 #define L2CAP_TERM_RX_ERROR 0x0007
210 #define L2CAP_TERM_TX_ERROR 0x0008
211 #define L2CAP_TERM_MEM_ALLOC_ERROR 0x0009
212 
213 
220 #define L2CAP_CLOSED 0x00U
221 #define L2CAP_OPEN 0x01U
222 #define L2CAP_PENDING_CONN_RSP 0x02U
223 #define L2CAP_PENDING_DISCONN_RSP 0x03U
224 #define L2CAP_PENDING_PARAM_UPDATE_RSP 0x04U
225 #define L2CAP_PENDING_INFO_RSP 0x05U
226 #define L2CAP_PENDING_SEC_VERIFY 0x06U
227 
228 
235 #define L2CAP_INFO_CONNLESS_MTU 0x0001
236 #define L2CAP_INFO_EXTENDED_FEATURES 0x0002
237 #define L2CAP_INFO_FIXED_CHANNELS 0x0003
238 
239 
241 /*********************************************************************
242  * Information Response: Extended Features Mask Values
243  */
244 #define L2CAP_FIXED_CHANNELS 0x00000080
245 
246 #define L2CAP_EXTENDED_FEATURES_SIZE 4
247 
248 /*********************************************************************
249  * Information Response: Fixed Channels Mask Values
250  */
251 #define L2CAP_FIXED_CHANNELS_ATT 0x10
252 
253 #define L2CAP_FIXED_CHANNELS_SIG 0x20
254 
255 #define L2CAP_FIXED_CHANNELS_SMP 0x40
256 
257 #define L2CAP_FIXED_CHANNELS_SIZE 8
258 
259 /*********************************************************************
260  * Information Response: Result Values
261  */
262 #define L2CAP_INFO_SUCCESS 0x0000
263 
264 #define L2CAP_INFO_NOT_SUPPORTED 0x0001
265 
266 
268 /*********************************************************************
269  * L2CAP Test Modes: Test code values
270  */
271 #if defined ( TESTMODES )
272  // Test modes 0 through 10 are reserved for L2CAP Connection Request.
273  #define L2CAP_TESTMODE_OFF 0
274  #define L2CAP_TESTMODE_PSM_NOT_SUPPORTED 2
275  #define L2CAP_TESTMODE_NO_RESOURCES 4
276  #define L2CAP_TESTMODE_INSUFF_AUTHEN 5
277  #define L2CAP_TESTMODE_INSUFF_AUTHOR 6
278  #define L2CAP_TESTMODE_INSUFF_KEY_SIZE 7
279  #define L2CAP_TESTMODE_INSUFF_ENCRYPT 8
280  #define L2CAP_TESTMODE_INVALID_SRC_CID 9
281  #define L2CAP_TESTMODE_SRC_CID_ALREADY_ALLOC 10
282  #define L2CAP_TESTMODE_OUT_OF_RANGE_CREDITS 11
283  #define L2CAP_TESTMODE_SDU_LEN_EXCEED 12
284  #define L2CAP_TESTMODE_TX_PKT_NO_CREDIT 13
285  #define L2CAP_TESTMODE_BLOCK_DATA_TX 14
286 #endif
287 
289 
292 /*********************************************************************
293  * MACROS
294  */
295 
296 /*********************************************************************
297  * TYPEDEFS
298  */
300 typedef enum
301 {
310 typedef struct
312 {
313  uint8 maxNumPSM;
316 
318 typedef struct
319 {
320  uint16 localCID;
321  uint16 remoteCID;
323 
325 typedef union
326 {
327  uint16 signalMTU;
330 
332 typedef struct
333 {
334  uint16 reason;
336 
337  // Shorthand access for union members
338  #define maxSignalMTU reasonData.signalMTU
339  #define invalidLocalCID reasonData.invalidCID.localCID
340  #define invalidRemoteCID reasonData.invalidCID.remoteCID
341 } l2capCmdReject_t;
342 
344 typedef struct
345 {
346  uint16 intervalMin;
347  uint16 intervalMax;
351 
353 typedef struct
354 {
355  uint16 result;
357 
359 typedef struct
360 {
361  uint16 infoType;
363 
365 typedef union
366 {
369  uint8 fixedChannels[L2CAP_FIXED_CHANNELS_SIZE];
370 } l2capInfo_t;
371 
373 typedef struct
374 {
375  uint16 result;
376  uint16 infoType;
379 
381 typedef struct
382 {
383  uint16 psm;
384  uint16 srcCID;
385  uint16 mtu;
386  uint16 mps;
388  uint16 initCredits;
391 
393 typedef struct
394 {
395  uint16 dstCID;
396  uint16 mtu;
397  uint16 mps;
399  uint16 initCredits;
401  uint16 result;
403 
405 typedef struct
406 {
407  uint16 dstCID;
408  uint16 srcCID;
410 
412 typedef struct
413 {
414  uint16 dstCID;
415  uint16 srcCID;
417 
419 typedef struct
420 {
421  uint16 CID;
422  uint16 credits;
424 
426 typedef struct
427 {
428  uint16 mtu;
429  uint16 mps;
435 
437 typedef struct
438 {
439  uint16 connHandle;
440  uint16 psm;
441  uint16 mtu;
442  uint16 mps;
443  uint16 credits;
444  uint16 peerCID;
445  uint16 peerMtu;
446  uint16 peerMps;
447  uint16 peerCredits;
450 
452 typedef struct
453 {
454  uint8 state;
457 
459 typedef struct
460 {
461  uint16 connHandle;
462  uint16 CID;
464 
478 typedef struct
479 {
480  uint16 result;
481  uint16 CID;
484 
491 typedef struct
492 {
493  uint16 CID;
494  uint16 peerCID;
495  uint16 reason;
497 
504 typedef struct
505 {
506  uint16 CID;
507  uint16 peerCID;
508  uint16 credits;
511 
518 typedef struct
519 {
520  uint16 CID;
521  uint16 credits;
522  uint16 peerCID;
523  uint16 peerCredits;
524  uint16 totalLen;
525  uint16 txLen;
527 
534 typedef struct
535 {
536  uint8 numDataPkt;
538 
540 typedef union
541 {
542  // Requests
548 
549  // Responses
555 
556  // Proprietary local events
563 
570 typedef struct
571 {
573  uint16 connHandle;
574  uint8 id;
575  uint8 opcode;
578 
580 typedef struct
581 {
582  uint16 connHandle;
583  uint16 CID;
584  uint8 *pPayload;
585  uint16 len;
588 } l2capPacket_t;
589 
600 typedef struct
601 {
605 
627 typedef uint16 (*pfnVerifySecCB_t)( uint16 connHandle, uint8 id, l2capConnectReq_t *pReq );
628 
636 typedef struct
638 {
639  uint16 psm;
640  uint16 mtu;
641  uint16 mps;
644  uint16 initPeerCredits;
648  uint8 taskId;
650 } l2capPsm_t;
651  // end of L2CAP_Structs
653 
654 /*********************************************************************
655  * GLOBAL VARIABLES
656  */
657 
658 /*********************************************************************
659  * FUNCTIONS
660  */
661 
671 extern bStatus_t L2CAP_RegisterApp( uint8 taskId, uint16 CID );
672 
679 extern void L2CAP_RegisterFlowCtrlTask( uint8 taskId );
680 
703 extern bStatus_t L2CAP_SendData( l2capPacket_t *pPkt );
704 
717 extern bStatus_t L2CAP_RegisterPsm( l2capPsm_t *pPsm );
718 
729 extern bStatus_t L2CAP_DeregisterPsm( uint8 taskId, uint16 psm );
730 
740 extern bStatus_t L2CAP_PsmInfo( uint16 psm, l2capPsmInfo_t *pInfo );
741 
752 extern bStatus_t L2CAP_PsmChannels( uint16 psm, uint8 numCIDs, l2capLocalChannelInfo_t *pCIDs );
753 
764 extern bStatus_t L2CAP_ChannelInfo( uint16 connHandle, uint16 CID, l2capChannelInfo_t *pInfo );
765 
781 extern bStatus_t L2CAP_ConnectReq( uint16 connHandle, uint16 psm, uint16 peerPsm );
782 
796 extern bStatus_t L2CAP_ConnectRsp( uint16 connHandle, uint8 id, uint16 result );
797 
811 extern bStatus_t L2CAP_DisconnectReq( uint16 connHandle, uint16 CID );
812 
827 extern bStatus_t L2CAP_FlowCtrlCredit( uint16 connHandle, uint16 CID, uint16 peerCredits );
828 
844 extern bStatus_t L2CAP_SendSDU( l2capPacket_t *pPkt );
845 
859 extern bStatus_t L2CAP_CmdReject( uint16 connHandle, uint8 id, l2capCmdReject_t *pCmdReject );
860 
875 extern bStatus_t L2CAP_InfoReq( uint16 connHandle, l2capInfoReq_t *pInfoReq, uint8 taskId );
876 
892 extern bStatus_t L2CAP_ConnParamUpdateReq( uint16 connHandle, l2capParamUpdateReq_t *pUpdateReq, uint8 taskId );
893 
907 extern bStatus_t L2CAP_ConnParamUpdateRsp( uint16 connHandle, uint8 id, l2capParamUpdateRsp_t *pUpdateRsp );
908 
917 extern void L2CAP_SetUserConfig( l2capUserCfg_t *pUserCfg );
918 
924 extern void L2CAP_GetUserConfig( l2capUserCfg_t *pL2capCfg );
925 
934 extern void L2CAP_SetBufSize( uint16 dataPktLen, uint8 numDataPkts );
935 
941 extern uint16 L2CAP_GetMTU( void );
942 
955 extern void *L2CAP_bm_alloc( uint16 size );
956 
965 extern uint16 L2CAP_BuildConnectReq( uint8 *pBuf, uint8 *pData );
966 
977 extern bStatus_t L2CAP_ParseConnectReq( l2capSignalCmd_t *pCmd, uint8 *pData, uint16 len );
978 
989 extern bStatus_t L2CAP_ParseFlowCtrlCredit( l2capSignalCmd_t *pCmd, uint8 *pData, uint16 len );
990 
999 extern uint16 L2CAP_BuildCmdReject( uint8 *pBuf, uint8 *pCmd );
1000 
1011 extern bStatus_t L2CAP_ParseInfoReq( l2capSignalCmd_t *pCmd, uint8 *pData, uint16 len );
1012 
1023 extern bStatus_t L2CAP_ParseParamUpdateReq( l2capSignalCmd_t *pCmd, uint8 *pData, uint16 len );
1024 
1033 extern uint16 L2CAP_BuildParamUpdateRsp( uint8 *pBuf, uint8 *pData );
1034 
1043 extern uint16 L2CAP_BuildInfoRsp( uint8 *pBuf, uint8 *pData );
1044 
1052 extern void L2CAP_SetControllerToHostFlowCtrl( uint16 hostBuffSize, uint8 flowCtrlMode );
1053 
1064 extern void L2CAP_HostNumCompletedPkts( uint16 connHandle, uint16 numCompletedPkts );
1065 
1073 extern void L2CAP_SetParamValue( uint16 value );
1074 
1080 extern uint16 L2CAP_GetParamValue( void );
1081 
1082 /*-------------------------------------------------------------------
1083  * TASK API - These functions must only be called by OSAL.
1084  */
1085 
1087 
1095 extern void L2CAP_Init( uint8 taskId );
1096 
1106 extern uint32 L2CAP_ProcessEvent( uint8 taskId, uint32 events );
1107 
1109 
1110 /*********************************************************************
1111 *********************************************************************/
1112 
1113 #ifdef __cplusplus
1114 }
1115 #endif
1116 
1117 #endif /* L2CAP_H */
1118 
uint8 numActiveChannels
Number of active CO Channels.
Definition: l2cap.h:433
uint16 remoteCID
Source CID from the rejected command.
Definition: l2cap.h:321
Local channel information format.
Definition: l2cap.h:452
uint16 connHandle
connection handle
Definition: l2cap.h:582
uint16 peerCreditThreshold
Low threshold for number of peer credits.
Definition: l2cap.h:431
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:602
l2capConnectRsp_t connectRsp
LE Credit Based Connection Response.
Definition: l2cap.h:553
uint16 intervalMin
Minimum Interval.
Definition: l2cap.h:346
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:627
Command Reject format.
Definition: l2cap.h:332
bStatus_t L2CAP_ConnParamUpdateRsp(uint16 connHandle, uint8 id, l2capParamUpdateRsp_t *pUpdateRsp)
Send Connection Parameter Update Response.
uint16 CID
Local channel id.
Definition: l2cap.h:520
uint16 CID
local channel id
Definition: l2cap.h:583
Command Reject Reason Data format.
Definition: l2cap.h:325
l2capParamUpdateReq_t updateReq
Connection Parameter Update Request.
Definition: l2cap.h:543
uint8 maxNumCoChannels
Max number of Connection Oriented Channels: L2CAP_NUM_CO_CHANNELS_DEFAULT.
Definition: l2cap.h:314
Information Response Data field.
Definition: l2cap.h:365
uint16 totalLen
Total length of SDU being transmitted.
Definition: l2cap.h:524
uint16 localCID
Destination CID from the rejected command.
Definition: l2cap.h:320
bStatus_t L2CAP_RegisterPsm(l2capPsm_t *pPsm)
Register a Protocol/Service Multiplexer (PSM) with L2CAP.
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:257
uint16 initPeerCredits
Number of LE-frames that peer device can send.
Definition: l2cap.h:430
Connection oriented channel information format.
Definition: l2cap.h:437
uint16 result
Result.
Definition: l2cap.h:375
uint16 result
Indicates outcome of connection request: L2CAP Connection Response Result Values. ...
Definition: l2cap.h:401
Disconnection Response format (src/dst CIDs are relative to sender of request).
Definition: l2cap.h:412
uint16 mtu
Definition: l2cap.h:640
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:448
uint16 peerMps
Maximum payload size that can be received by peer device.
Definition: l2cap.h:446
Disconnection Request format (src/dst CIDs are relative to sender of request).
Definition: l2cap.h:405
l2capNumCtrlDataPktEvt_t numCtrlDataPktEvt
Number of Available Ctrl Data Packets Event.
Definition: l2cap.h:561
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:414
l2capInfoRsp_t infoRsp
Information Response - not supported.
Definition: l2cap.h:551
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:361
uint16 connectionlessMTU
Connectionless MTU.
Definition: l2cap.h:367
uint16 L2CAP_BuildConnectReq(uint8 *pBuf, uint8 *pData)
Build Connection Request.
uint16 psm
LE PSM.
Definition: l2cap.h:383
Definition: l2cap.h:303
uint16 peerCID
Remote channel id.
Definition: l2cap.h:444
osal_event_hdr_t hdr
L2CAP_SIGNAL_EVENT and status.
Definition: l2cap.h:572
bStatus_t L2CAP_SendData(l2capPacket_t *pPkt)
Send data packet over an L2CAP fixed channel established over a physical connection.
l2capReasonData_t reasonData
Reason Data.
Definition: l2cap.h:335
void L2CAP_SetUserConfig(l2capUserCfg_t *pUserCfg)
Set the user configurable variables for the L2CAP layer.
uint16 CID
Local channel id.
Definition: l2cap.h:493
uint16 srcCID
Specifies CID to be disconnected on device sending request.
Definition: l2cap.h:408
uint16 CID
Represents Source CID of device sending credit packet.
Definition: l2cap.h:421
uint8 maxNumPSM
Max number of Protocol/Service Multiplexers (PSM): L2CAP_NUM_PSM_DEFAULT.
Definition: l2cap.h:313
uint16 peerCID
Peer channel id.
Definition: l2cap.h:522
uint16 mtu
Definition: l2cap.h:396
uint8 * pPayload
Definition: l2cap.h:584
l2capConEstablishRole_t
Address modes to initialize the local device.
Definition: l2cap.h:300
uint8 state
Channel connection state: L2CAP Channel States.
Definition: l2cap.h:454
bStatus_t L2CAP_FlowCtrlCredit(uint16 connHandle, uint16 CID, uint16 peerCredits)
Send Flow Control Credit.
uint16 txLen
Total number of octets transmitted.
Definition: l2cap.h:525
uint16 reason
Indicates reason for termination: L2CAP Channel Terminated Event Reason Values.
Definition: l2cap.h:495
uint8 taskId
Task registered with PSM.
Definition: l2cap.h:648
L2CAP PSM structure. Allocated one for each registered PSM.
Definition: l2cap.h:637
l2capInfo_t info
Content of Info field depends on infoType.
Definition: l2cap.h:377
uint16 L2CAP_BuildInfoRsp(uint8 *pBuf, uint8 *pData)
Build Information Response.
bStatus_t L2CAP_InfoReq(uint16 connHandle, l2capInfoReq_t *pInfoReq, uint8 taskId)
Send Information Request.
uint8 id
identifier to match responses with requests
Definition: l2cap.h:574
uint16 connHandle
Connection handle the channel belongs to.
Definition: l2cap.h:439
void L2CAP_HostNumCompletedPkts(uint16 connHandle, uint16 numCompletedPkts)
Host Number of Completed Packets.
L2CAP_CHANNEL_TERMINATED_EVT message format.
Definition: l2cap.h:491
uint16 mps
Maximum payload size that can be received by local device.
Definition: l2cap.h:429
uint16 peripheralLatency
Peripheral Latency.
Definition: l2cap.h:348
PSM information format.
Definition: l2cap.h:426
uint16 result
Result: L2CAP Connection Parameter Update Response Result Values.
Definition: l2cap.h:355
Union of all L2CAP Signaling commands.
Definition: l2cap.h:540
uint8 numDataPkt
Number of Data Packets Available.
Definition: l2cap.h:536
uint16 srcCID
Represents CID on device sending request and receiving response.
Definition: l2cap.h:384
l2capDisconnectReq_t disconnectReq
Disconnection Request.
Definition: l2cap.h:546
uint16 peerCreditThreshold
Low threshold for peer credit count.
Definition: l2cap.h:646
Connection Request format.
Definition: l2cap.h:381
uint16 signalMTU
Maximum Signaling MTU.
Definition: l2cap.h:327
uint16 peerCredits
Peer credits.
Definition: l2cap.h:523
L2CAP_OUT_OF_CREDIT_EVT or L2CAP_PEER_CREDIT_THRESHOLD_EVT message format.
Definition: l2cap.h:504
Invalid CID in Request format.
Definition: l2cap.h:318
bStatus_t L2CAP_ChannelInfo(uint16 connHandle, uint16 CID, l2capChannelInfo_t *pInfo)
Get information about a given active Connection Oriented Channel.
uint8 maxNumChannels
Maximum number of CO Channels supported by PSM.
Definition: l2cap.h:432
pfnVerifySecCB_t pfnVerifySecCB
PSM security verification callback (can be NULL)
Definition: l2cap.h:649
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:447
uint32 extendedFeatures
Extended features supported.
Definition: l2cap.h:368
uint16 peerMtu
Maximum SDU size that can be received by peer device.
Definition: l2cap.h:445
Always Use Public Address.
Definition: l2cap.h:302
l2capSignalCmd_t cmd
command data
Definition: l2cap.h:576
l2capParamUpdateRsp_t updateRsp
Connection Parameter Update Response.
Definition: l2cap.h:550
L2CAP_CHANNEL_ESTABLISHED_EVT message format.
Definition: l2cap.h:478
l2capSendSduDoneEvt_t sendSduDoneEvt
Send SDU Done Event.
Definition: l2cap.h:560
l2capInvalidCID_t invalidCID
Invalid CID in Request.
Definition: l2cap.h:328
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:575
L2CAP_NUM_CTRL_DATA_PKT_EVT message format.
Definition: l2cap.h:534
uint16 credits
Definition: l2cap.h:508
Information Response format.
Definition: l2cap.h:373
bStatus_t L2CAP_ParseFlowCtrlCredit(l2capSignalCmd_t *pCmd, uint8 *pData, uint16 len)
Parse Flow Control Credit message.
uint16 connHandle
Connection handle.
Definition: l2cap.h:461
User configurable variables format.
Definition: l2cap.h:311
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:395
Information Request format.
Definition: l2cap.h:359
bStatus_t L2CAP_CmdReject(uint16 connHandle, uint8 id, l2capCmdReject_t *pCmdReject)
Send Command Reject.
uint16 intervalMax
Maximum Interval.
Definition: l2cap.h:347
uint16 CID
Channel CID.
Definition: l2cap.h:462
Generic Event Header.
Definition: bcomdef.h:223
l2capInfoReq_t infoReq
Information Request - not supported.
Definition: l2cap.h:544
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:559
bStatus_t L2CAP_ParseInfoReq(l2capSignalCmd_t *pCmd, uint8 *pData, uint16 len)
Parse Information Request message.
l2capDisconnectRsp_t disconnectRsp
Disconnection Response.
Definition: l2cap.h:554
l2capChannelEstEvt_t channelEstEvt
Channel Established Event.
Definition: l2cap.h:557
bStatus_t L2CAP_DisconnectReq(uint16 connHandle, uint16 CID)
Send Disconnection Request.
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 connHandle
connection message was received on
Definition: l2cap.h:573
L2CAP packet structure.
Definition: l2cap.h:580
OSAL L2CAP_SIGNAL_EVENT message format.
Definition: l2cap.h:570
l2capPacket_t pkt
received packet
Definition: l2cap.h:603
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:428
uint16 peerCID
Peer channel id.
Definition: l2cap.h:494
uint16 mtu
Maximum SDU size that can be received by local device.
Definition: l2cap.h:441
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:440
l2capFlowCtrlCredit_t credit
LE Flow Control Credit.
Definition: l2cap.h:547
uint16 mps
Maximum payload size that can be received by local device.
Definition: l2cap.h:442
uint16 reason
Reason: L2CAP Command Reject Reason Codes.
Definition: l2cap.h:334
L2CAP_FLOW_CTRL_CREDIT or L2CAP_PEER_CREDIT_RECEIVED_EVT payload's message format.
Definition: l2cap.h:419
uint16 dstCID
Specifies CID to be disconnected on device receiving request.
Definition: l2cap.h:407
l2capCoCInfo_t info
Channel info.
Definition: l2cap.h:455
uint16 credits
Number of LE-frames that local device can send.
Definition: l2cap.h:443
uint16 infoType
Information type: L2CAP Information Request/Response Info Types.
Definition: l2cap.h:376
bStatus_t L2CAP_PsmChannels(uint16 psm, uint8 numCIDs, l2capLocalChannelInfo_t *pCIDs)
Get all active channels for a given registered PSM.
uint16 credits
Number of LE-frames that can be sent to local device (credits received)
Definition: l2cap.h:422
l2capCoCInfo_t info
Channel info.
Definition: l2cap.h:482
uint16 L2CAP_GetParamValue(void)
Get the L2CAP parameter value.
L2CAP_SEND_SDU_DONE_EVT message format.
Definition: l2cap.h:518
void L2CAP_SetControllerToHostFlowCtrl(uint16 hostBuffSize, uint8 flowCtrlMode)
Turn flow control on or off for data packets sent from the Controller to the Host.
uint16 timeoutMultiplier
Timeout Multiplier.
Definition: l2cap.h:349
void L2CAP_SetParamValue(uint16 value)
Set the L2CAP parameter value.
uint16 CID
Local channel id.
Definition: l2cap.h:506
uint16 CID
Local channel id.
Definition: l2cap.h:481
Connection Response format.
Definition: l2cap.h:393
uint16 srcCID
Identifies CID on device receiving response.
Definition: l2cap.h:415
uint16 L2CAP_BuildParamUpdateRsp(uint8 *pBuf, uint8 *pData)
Build Connection Parameter Update Response.
void L2CAP_GetUserConfig(l2capUserCfg_t *pL2capCfg)
Get the user configurable variables for the L2CAP layer.
uint16 psm
Registered PSM.
Definition: l2cap.h:639
l2capChannelTermEvt_t channelTermEvt
Channel Terminated Event.
Definition: l2cap.h:558
void * L2CAP_bm_alloc(uint16 size)
L2CAP implementation of the allocator functionality.
uint8_t bStatus_t
BLE Generic Status return.
Definition: bcomdef.h:220
Connection Parameter Update Response format.
Definition: l2cap.h:353
uint16 peerCID
Peer channel id.
Definition: l2cap.h:507
Local connection handle and channel pair format.
Definition: l2cap.h:459
Connection Parameter Update Request format.
Definition: l2cap.h:344
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:545
uint16 mtu
Definition: l2cap.h:385
OSAL L2CAP_DATA_EVENT message format.
Definition: l2cap.h:600
uint8 maxNumChannels
Maximum number of CO Channels supported by PSM.
Definition: l2cap.h:647
uint16 result
Indicates outcome of connection request: L2CAP Connection Response Result Values. ...
Definition: l2cap.h:480
l2capCmdReject_t cmdReject
Command Reject.
Definition: l2cap.h:552
uint16 credits
Local credits.
Definition: l2cap.h:521
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale