[−][src]Module rubble::l2cap
The Logical Link Control and Adaptation Protocol (L2CAP).
Note that LE and Classic Bluetooth differ quite a bit on this layer, even though they're supposed to share L2CAP. We're only implementing the LE bits.
L2CAP provides "channels" to the upper layers that are mapped to the physical transport below
the L2CAP layer (the LE Link Layer or whatever Classic Bluetooth does). A channel is identified
by a 16-bit ID (also see Channel
), a few of which are reserved.
A minimal implementation for Classic Bluetooth must support the L2CAP signaling channel
(0x0001
). A minimal implementation for BLE has to support the L2CAP LE signaling channel
(0x0005
), the Attribute Protocol channel (0x0004
), and the LE Security Manager channel
(0x0006
).
Establishing new connection-oriented channels, as well as transferring data over the
connectionless channel (0x0002
) makes use of Protocol/Service Multiplexers (PSMs), which are
numbers identifying the protocol or service to use. These numbers are either defined by the
Bluetooth SIG or allocated dynamically for use with the Service Discovery Protocol (SDP). The
preallocated numbers are hosted online here.
Structs
BleChannelMap | A fixed BLE channel map that provides only the required channel endpoints and does not allow dynamic channels. |
Channel | An L2CAP channel identifier (CID). |
ChannelData | Data associated with a connected L2CAP channel. |
L2CAPState | L2CAP channel manager and responder. |
L2CAPResponder |
Traits
ChannelMapper | Trait for L2CAP channel mappers that provide access to the protocol or service behind a CID. |
Protocol | Trait for protocols that sit on top of L2CAP (non-object-safe part). |
ProtocolObj | Trait for protocols that sit on top of L2CAP (object-safe part). |