Skip to content

Add classic L2CAP connection conveniences#58

Merged
colemancda merged 2 commits into
masterfrom
feature/l2cap-classic
Jul 18, 2026
Merged

Add classic L2CAP connection conveniences#58
colemancda merged 2 commits into
masterfrom
feature/l2cap-classic

Conversation

@colemancda

Copy link
Copy Markdown
Member

Summary

Adds classic (BR/EDR) counterparts to the existing Low Energy L2CAP conveniences:

  • L2CAPSocket.classicClient and L2CAPSocket.classicServer — PSM-based connections using the ProtocolServiceMultiplexer enum (SDP, RFCOMM, BNEP, HID control/interrupt, AVDTP, and others), with CID 0 and no LE address type. Async HostController overloads read the adapter address automatically.
  • Matching wrappers on L2CAPSocket.Server and L2CAPSocket.Connection.
  • The non-blocking connect-and-poll logic is factored into a shared internal helper.

This is the missing transport piece for Personal Area Networking (#57) and unblocks future HID and SDP work.

Test plan

  • 3 new unit tests verifying classic and LE socket address encoding and decoding (PSM byte order, CID, address type). Socket address construction requires the Bluetooth address family, which is Linux-only, so these are gated to run in CI rather than on Darwin.
  • Full test suite passes
  • swift build succeeds with no new warnings
  • Live connections require Linux with a Bluetooth adapter

@colemancda
colemancda merged commit 78de5f8 into master Jul 18, 2026
1 check failed
@colemancda
colemancda deleted the feature/l2cap-classic branch July 18, 2026 06:12
@colemancda colemancda mentioned this pull request Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant