Data Link Layer: L2CAP
The Logical Link Control and Adaptation Layer Protocol (L2CAP) resides in the data link layer. L2CAP provides connection-oriented and connectionless data services to upper layer protocols.
The focus of this protocol is to add protocol multiplexing capability, segmentation and reassembly operation and group abstractions.
It is important to note that L2CAP specification is only defined for ACL logical transports and no SCO support is planned.
L2CAP packet structure
L2CAP general packet structure is defined as a basic frame or b-frame.
L2CAP provides different channels (CID - Channel identifier) where different protocols or services can be multiplexed. Some of the most common CIDs are
0x0001 for the Signaling Channel,
0x0002 for the Connectionless Channel or
0x0006 for the SMP (Security Manager Protocol).
Particularly, the Connectionless Channel defines an extended packet structure called group frame or g-frame that provides a second layer for service multiplexing called Protocol/Service Multiplexer or PSM.
PSM services are classified in two ranges. The first is assigned by the Bluetooth SIG while the second is free to be assigned by vendors. Bluetooth SIG assigned PSM services can be found in the Bluetooth Assigned numbers document at Sección 2.5. PSM services are further described in the Bluetooth Core Spec V5.3 Vol 3 Part A Section 4.2.