Skip to content

Add RFCOMM socket implementation#60

Merged
colemancda merged 3 commits into
masterfrom
feature/rfcomm
Jul 18, 2026
Merged

Add RFCOMM socket implementation#60
colemancda merged 3 commits into
masterfrom
feature/rfcomm

Conversation

@colemancda

Copy link
Copy Markdown
Member

Summary

Implements the RFCOMM socket (previously an empty stub), completing the serial port emulation transport:

  • RFCOMMSocket — bind, client connect to a remote device and channel (1-30) with non-blocking poll and timeout, server listen/accept on a channel, stream send/receive, and typed accessors for connection information, link mode (get/set), and security level (get/set).
  • Internal socket descriptor helper following the existing L2CAP and SCO patterns.

The existing RFCOMM infrastructure (socket address, socket options, link mode flags, and the TTY device ioctls) was already in place; this adds the missing socket layer that uses it. Together with the device ioctls this enables serial connections and binding them to /dev/rfcomm* TTYs.

Test plan

  • 3 new unit tests covering option level and identifiers and link mode bitmask encoding round-trips; the socket address encoding test is Linux-gated (Bluetooth address family is unavailable on Darwin) and runs in CI
  • Full test suite passes
  • swift build succeeds with no new warnings
  • Live serial connections require Linux and a remote device with an RFCOMM service

@colemancda
colemancda merged commit ca65b12 into master Jul 18, 2026
1 check passed
@colemancda
colemancda deleted the feature/rfcomm branch July 18, 2026 06:10
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