Mistake on this page?
Report an issue in GitHub or email us
Macros
l2c_defs.h File Reference

L2CAP constants and definitions from the Bluetooth specification. More...

Go to the source code of this file.

Macros

#define L2C_MAX_EN_CHAN   5
 Max number of channels per enhanced connection request. More...
 
#define L2C_PAYLOAD_START   (HCI_ACL_HDR_LEN + L2C_HDR_LEN)
 Start of L2CAP payload in an HCI ACL packet buffer. More...
 
#define L2C_SIG_PKT_BASE_LEN   (HCI_ACL_HDR_LEN + L2C_HDR_LEN + L2C_SIG_HDR_LEN)
 L2CAP signaling packet base length, including HCI header. More...
 
#define L2C_LE_SDU_PKT_BASE_LEN   (HCI_ACL_HDR_LEN + L2C_HDR_LEN + L2C_LE_SDU_HDR_LEN)
 L2CAP LE SDU packet base length, including HCI header. More...
 
#define L2C_SIG_RSP_FLAG   0x01
 Signaling response code flag. More...
 
L2CAP Packet Constants
#define L2C_HDR_LEN   4
 L2CAP packet header length. More...
 
#define L2C_MIN_MTU   23
 Minimum packet payload MTU for LE. More...
 
#define L2C_SIG_HDR_LEN   4
 L2CAP signaling command header length. More...
 
#define L2C_LE_SDU_HDR_LEN   2
 L2CAP LE SDU data header length. More...
 
L2CAP Parameter Lengths

Signaling packet parameter lengths

#define L2C_SIG_CONN_UPDATE_REQ_LEN   8
 Connection update request length. More...
 
#define L2C_SIG_CONN_UPDATE_RSP_LEN   2
 Connection update response length. More...
 
#define L2C_SIG_CMD_REJ_LEN   2
 Command reject length. More...
 
#define L2C_SIG_DISCONN_REQ_LEN   4
 Disconnection request length. More...
 
#define L2C_SIG_DISCONN_RSP_LEN   4
 Disconnection response length. More...
 
#define L2C_SIG_LE_CONN_REQ_LEN   10
 LE connection request length. More...
 
#define L2C_SIG_LE_CONN_RSP_LEN   10
 LE connection response length. More...
 
#define L2C_SIG_FLOW_CTRL_CREDIT_LEN   4
 Flow control credit lenghth. More...
 
#define L2C_SIG_EN_CONNECT_REQ_LEN   8
 Enhanced credit based connection request. More...
 
#define L2C_SIG_EN_CONNECT_RSP_LEN   8
 Enhanced credit based connection response. More...
 
#define L2C_SIG_EN_RECONFIG_REQ_LEN   4
 Enhanced credit based reconfiguration request. More...
 
#define L2C_SIG_EN_RECONFIG_RSP_LEN   2
 Enhanced credit based reconfiguration response. More...
 
L2CAP Connection Identifiers

BLE Defined Connection Identifiers (CID)

#define L2C_CID_ATT   0x0004
 CID for attribute protocol. More...
 
#define L2C_CID_LE_SIGNALING   0x0005
 CID for LE signaling. More...
 
#define L2C_CID_SMP   0x0006
 CID for security manager protocol. More...
 
L2CAP Signaling Codes
#define L2C_SIG_CMD_REJ   0x01
 Comand reject. More...
 
#define L2C_SIG_DISCONNECT_REQ   0x06
 Disconnect request. More...
 
#define L2C_SIG_DISCONNECT_RSP   0x07
 Disconnect response. More...
 
#define L2C_SIG_CONN_UPDATE_REQ   0x12
 Connection parameter update request. More...
 
#define L2C_SIG_CONN_UPDATE_RSP   0x13
 Connection parameter update response. More...
 
#define L2C_SIG_LE_CONNECT_REQ   0x14
 LE credit based connection request. More...
 
#define L2C_SIG_LE_CONNECT_RSP   0x15
 LE credit based connection response. More...
 
#define L2C_SIG_FLOW_CTRL_CREDIT   0x16
 LE flow control credit. More...
 
#define L2C_SIG_EN_CONNECT_REQ   0x17
 Enhanced credit based connection request. More...
 
#define L2C_SIG_EN_CONNECT_RSP   0x18
 Enhanced credit based connection response. More...
 
#define L2C_SIG_EN_RECONFIG_REQ   0x19
 Enhanced credit based reconfiguration request. More...
 
#define L2C_SIG_EN_RECONFIG_RSP   0x1A
 Enhanced credit based reconfiguration response. More...
 
L2CAP Command Rejection Codes

BLE defined Command rejection reason codes

#define L2C_REJ_NOT_UNDERSTOOD   0x0000
 Command not understood. More...
 
#define L2C_REJ_MTU_EXCEEDED   0x0001
 Signaling MTU exceeded. More...
 
#define L2C_REJ_INVALID_CID   0x0002
 Invalid CID in request. More...
 
L2CAP Connection Parameter Update Result Codes

BLE defined result codes

#define L2C_CONN_PARAM_ACCEPTED   0x0000
 Connection parameters accepted. More...
 
#define L2C_CONN_PARAM_REJECTED   0x0001
 Connection parameters rejected. More...
 
L2CAP Connection Result Codes

BLE defined result codes

#define L2C_CONN_SUCCESS   0x0000
 Connection successful. More...
 
#define L2C_CONN_NONE   0x0001
 No connection result value available. More...
 
#define L2C_CONN_FAIL_PSM   0x0002
 Connection refused LE_PSM not supported. More...
 
#define L2C_CONN_FAIL_RES   0x0004
 Connection refused no resources available. More...
 
#define L2C_CONN_FAIL_AUTH   0x0005
 Connection refused insufficient authentication. More...
 
#define L2C_CONN_FAIL_AUTHORIZ   0x0006
 Connection refused insufficient authorization. More...
 
#define L2C_CONN_FAIL_KEY_SIZE   0x0007
 Connection refused insufficient encryption key size. More...
 
#define L2C_CONN_FAIL_ENC   0x0008
 Connection Refused insufficient encryption. More...
 
#define L2C_CONN_FAIL_INVALID_SCID   0x0009
 Connection refused invalid source CID. More...
 
#define L2C_CONN_FAIL_ALLOCATED_SCID   0x000A
 Connection refused source CID already allocated. More...
 
#define L2C_CONN_FAIL_UNACCEPT_PARAM   0x000B
 Connection refused unacceptable parameters. More...
 
#define L2C_CONN_FAIL_INVALID_PARAM   0x000C
 Connection refused invalid parameters. More...
 
L2CAP Interal Connection Result Codes

Proprietary codes not sent in any L2CAP packet.

#define L2C_CONN_FAIL_TIMEOUT   0xF000
 Request timeout. More...
 
L2CAP Signaling Parameter Value Ranges
#define L2C_PSM_MIN   0x0001
 PSM minimum. More...
 
#define L2C_PSM_MAX   0x00FF
 PSM maximum. More...
 
#define L2C_CID_DYN_MIN   0x0040
 CID dynamic minimum. More...
 
#define L2C_CID_DYN_MAX   0x007F
 CID dynamic maximum. More...
 
#define L2C_MTU_MIN   0x0017
 MTU minimum. More...
 
#define L2C_MPS_MIN   0x0017
 MPS minimum. More...
 
#define L2C_MPS_MAX   0xFFFD
 MPS maximum. More...
 
#define L2C_CREDITS_MAX   0xFFFF
 Credits maximum. More...
 
L2CAP Enhanced Connection Reconfigure Result Codes
#define L2C_RECONFIG_FAIL_MTU   0x0001
 Enhanced Reconfiguration refuded - cannot reduce MTU. More...
 
#define L2C_RECONFIG_FAIL_MPS   0x0002
 Enhanced Reconfiguration refuded - cannot reduce MPS on more than one channel. More...
 
#define L2C_RECONFIG_FAIL_CID   0x0003
 Enhanced Reconfiguration refuded - invalid CID. More...
 
#define L2C_RECONFIG_FAIL_PARAM   0x0004
 Enhanced Reconfiguration refuded - unacceptable parameters. More...
 

Detailed Description

L2CAP constants and definitions from the Bluetooth specification.

Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved.

Copyright (c) 2019-2020 Packetcraft, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file l2c_defs.h.

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.