You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support for Bluetooth LE L2CAP Connection-oriented channels through AF_BLUETOOTH/BTPROTO_L2CAP socket #129288
As has been discussed previously (69242, 70145), "new" fields have been added in sockaddr_l2, but are still not supported in CPython's socket implementation.
The lack of l2_bdaddr_type prevents opening L2CAP connection-oriented channels to Bluetooth LE devices.
Likewise, the missing l2_cid prevents raw access to e.g ATT.
My suggestion is to add support for a third and fourth optional element in the address tuple for l2_cid and l2_bdaddr_type respectively.
Only one of psm and cid can be non-zero. This is enforced by the kernel.
l2_bdaddr_type can take the value of BDADDR_LE_PUBLIC or BDADDR_LE_RANDOM. BDADDR_BREDR is implied if the element is missing, preserving compatibility with existing code.
Activity
pythongh-129288: Add optional bdaddr_type in BTPROTO_L2CAP socket add…
pythongh-129288: Expose socket.BDADDR_BREDR, socket.BDADDR_LE_PUBLIC,…
pythongh-129288: Add optional CID field in BTPROTO_L2CAP socket addre…
pythongh-129288: Fix NEWS blurb formatting
Merge branch 'main' into pythongh-129288
pythongh-129288: Update docs for socket to include new BTPROTO_L2CAP …
Merge branch 'main' into pythongh-129288
themadinventor commentedon Feb 23, 2025
Kindly reminding about this PR, which I hope is uncontroversial and quick to review :)
(The docs says it's ok to ping after one month of no feedback, to make sure it's not forgotten [1].)
[1] https://devguide.python.org/getting-started/pull-request-lifecycle/#reviewing
pythongh-129288: Improve docs for socket on BTPROTO_L2CAP, BDADDR_BRE…
pythongh-129288: Move BDADDR_BREDR et al macros to use BTPROTO_L2CAP …
pythongh-129288: Update comment re discarding cid for BR/EDR L2CAP so…
Merge pull request #1 from encukou/pythongh-129288
pythongh-129288: Add tests for BTPROTO_L2CAP socket
pythongh-129288: Add HAVE_SOCKET_BLUETOOTH_L2CAP to socket tests
pythongh-129288 Revert skip criteria for testCreateL2capSocket
gh-129288: Add optional l2_cid and l2_bdaddr_type in BTPROTO_L2CAP so…
encukou commentedon Feb 27, 2025
Thank you for the addition!