Skip to content

Releases: kylebrowning/BLESwift

2.1.0

Choose a tag to compare

@kylebrowning kylebrowning released this 01 Sep 02:32

BLE in the iOS Simulator

BLESwift 2.1.0 makes BLE work in the iOS Simulator, where CoreBluetooth is non-functional. Purely additive — no breaking API changes.

Added

  • Simulator link — new BLESwiftLink, BLESwiftSimulatorLink, and BLESwiftProvider products plus a bleswift-provider executable. Call SimulatorLink.install() in your simulator build and every subsequently-constructed Central() / PeripheralHost() is routed over a localhost TCP link to a bleswift-provider process on the host Mac, which serves it from the Mac's real radio (--passthrough), an in-process virtual radio, or both. Endpoint is configurable via BLESWIFT_LINK, and SimulatorLink.isProviderReachable() probes for a running provider. See the "Running in the iOS Simulator" DocC article.
  • Virtual devices — a declarative JSON fixture format (bleswift-provider --fixture) for virtual devices with advertisements and GATT databases, plus Provider.addVirtualDevice(_:advertising:) for hosting virtual devices written in Swift and driving them through a VirtualDeviceHandle.
  • BackendRegistry (BLESwiftCore) — process-wide optional backend factories consulted by Central(configuration:) / PeripheralHost(configuration:) when building their default backend. Nothing registered means CoreBluetooth is constructed exactly as before.
  • BLESwiftExplorer — an Advertise tab driving PeripheralHost, and --auto-advertise / --auto-scan launch arguments for automated runs.
  • Two-simulator end-to-end test (Scripts/sim-to-sim-e2e.sh) and CI job: two simulator apps meet on the provider's virtual radio — one advertising, one scanning and connecting — with no Bluetooth hardware and no entitlements.

Fixed

  • HostSession no longer counts backend-refused duplicate addService requests against maximumHostedServices, so repeated duplicate adds can't exhaust the service budget (#26).
  • CentralSession's L2CAP pump now identity-checks before forwarding inbound bytes, so a torn-down bridge can't write a dead channel's bytes under a re-issued channel id (#27).
  • Provider.addVirtualDevice registrations that race an overlapping stop() are rolled back instead of stranding the device on the radio (#29).
  • A failed Provider.start() (e.g. port already in use) now rolls back its fixture registrations, so a retry doesn't double-register fixtures and strand vended handles (#30).
  • Hardened provider session lifecycle and L2CAP bookkeeping (#39), plus review-finding fixes across the virtual radio, composites, and link shutdown (#41).

Known limitation

  • The --passthrough L2CAP path pairs channel-open completions by arrival order per peripheral (CoreBluetooth's callback carries nothing naming the open it answers); a completion arriving after a reconnect-and-reopen can be taken for the new open. Documented in the "Running in the iOS Simulator" article; virtual devices are unaffected (#28).

Full Changelog: 2.0.0...2.1.0

2.0.0

Choose a tag to compare

@kylebrowning kylebrowning released this 25 Aug 02:44
a3b9ac0

Full Changelog: 1.0.2...2.0.0

1.0.2

Choose a tag to compare

@kylebrowning kylebrowning released this 17 Aug 16:37
8f8d66d

What's Changed

  • Fence the peripheral role behind #if os(iOS) || os(macOS) by @kylebrowning in #23

Full Changelog: 1.0.1...1.0.2

1.0.1

Choose a tag to compare

@kylebrowning kylebrowning released this 01 Aug 03:45

What's Changed

Full Changelog: 1.0.0...1.0.1

BLESwift 1.0.0

Choose a tag to compare

@kylebrowning kylebrowning released this 19 Jul 15:35

First stable release.

Async/await-first Bluetooth LE for Swift 6.2: actor-isolated CoreBluetooth, AsyncSequence scanning, typed GATT operations (read/write/notify, descriptors, full GATT enumeration with SIG assigned names), L2CAP connection-oriented channels, multicast notifications, pairing, background restoration for both central and peripheral roles, and a hardware-free FakeCentral/FakePeripheral test rig in BLESwiftTestSupport.

Includes the fix for L2CAP channels closing immediately after opening (the underlying CBL2CAPChannel is now retained for the channel's lifetime), verified end-to-end against real hardware by BLESwiftCLI.

Licensed under Apache 2.0.