Describe the bug
The l2cap_coc_acceptor and l2cap_coc_initiator samples hardcode:
#define PSM 0x29
The acceptor README also states that the sample listens on a dynamic PSM.
For LE Credit-Based L2CAP channels, this value is an SPSM according to current Bluetooth terminology. The Bluetooth Core Specification defines the SPSM ranges as:
0x0001-0x007F: Fixed, Bluetooth SIG assigned0x0080-0x00FF: Dynamic
Zephyr's bt_l2cap_server documentation defines the same ranges.
Therefore, 0x29 is in the SIG-assigned range and is not a dynamic/application SPSM. It is currently unassigned in the Bluetooth Assigned Numbers list, but the range is reserved for assignments made by the Bluetooth SIG.
The sample still works when both sides use the same value, but it demonstrates using a value from the wrong range and describes it as dynamic.
For a minimal paired sample, a value from the dynamic range such as 0x80 could be used instead. Alternatively, the server could use .psm = 0 to request dynamic allocation and expose the allocated SPSM to the client through GATT, which is the mechanism described by the Zephyr API documentation.
Regression
- This is a regression.