Swift Bluetooth

The USB BLE adapter for Swift

Dongl is a USB Bluetooth Low Energy adapter you drive from Swift with SimpleSwiftBLE. Scan, connect, and pair through its own radio on macOS, with real device addresses and Swift concurrency from the first call.

Kober Engineering
InsuLearn
Meta
Fender
Honeywell
Bionic Labs
Sona
SWT
Moon Smart Focus
Lewitt
Medra
Desko
g.tec
IXI
Innovision
Moonlighting Industries
Kober Engineering
InsuLearn
Meta
Fender
Honeywell
Bionic Labs
Sona
SWT
Moon Smart Focus
Lewitt
Medra
Desko
g.tec
IXI
Innovision
Moonlighting Industries
Kober Engineering
InsuLearn
Meta
Fender
Honeywell
Bionic Labs
Sona
SWT
Moon Smart Focus
Lewitt
Medra
Desko
g.tec
IXI
Innovision
Moonlighting Industries
Get started

Set up in three steps

  1. Get an adapter

    Pre-order a Dongl, or flash the free Dongl firmware onto a Nordic nRF52840 Dongle or DK you already own.

  2. Install SimpleSwiftBLE

    Add https://github.com/simpleble/simpleswiftble with Swift Package Manager.

  3. Select the adapter

    A plugged-in Dongl appears as its own adapter, next to the computer's Bluetooth. Take the adapters of the Dongl backend and your code runs on the Dongl.

Select the Dongl, then scan, connect, and read. This is the code for each step.

import SimpleSwiftBLE

let adapter = try Backend.getDongl().getAdapters().first!
print("\(adapter.identifier) [\(adapter.address)]")
In Swift today

What Swift uses today

On a Mac, Swift reaches Bluetooth through CoreBluetooth, which always uses the system's own controller.

CoreBluetooth

CBCentralManager has no option to choose a controller, and it reports each device as an identifier that only that Mac recognizes.

IOBluetooth

IOBluetoothHostController exposes only the default controller.

A system-wide switch

Moving a Mac to a USB Bluetooth adapter takes a system-wide nvram setting, and it changes Bluetooth for every app on the Mac.

Why Dongl

What a Dongl gives your Swift code

Addresses

Real addresses on the Mac

CoreBluetooth hides a device's address behind an identifier only that Mac knows. A Dongl reports the real address and address type.

Adapters

More than one radio on a Mac

Each Dongl is another adapter with its own radio. Plug in one per test fixture.

Concurrency

async and await

Calls on different Dongls run in parallel, so a task group checks several devices at once.

Pairing

Pairing from your Swift code

Your code answers passkey and numeric-comparison prompts, with no system dialog. Bonds stay on the Dongl.

Consistency

The same Bluetooth on every Mac

Test stations running the same firmware behave the same, whatever the Mac or macOS version.

Support

A direct line to the engineers

Commercial customers work directly with the team that builds SimpleBLE and the Dongl firmware.

Plug in a Dongl and run your Swift code

Dongl hardware ships with the firmware installed and includes a commercial license to use SimpleBLE through the Dongl backend.

Frequently
asked questions

Plug in a Dongl, add SimpleSwiftBLE with Swift Package Manager, and take the adapters of the Dongl backend with Backend.getDongl().getAdapters(). Each Dongl is an adapter with its own radio, and it works through the same API as the Mac's Bluetooth.

Through a Dongl, yes. CoreBluetooth reports an identifier that only that Mac recognizes. A Dongl reports the real address and address type, so a Mac test station matches devices by the address printed on their label.

Yes, with Dongls. macOS gives an application one built-in radio, and each Dongl is another adapter. Calls on different adapters run in parallel.

No. Pairing through a Dongl happens without the operating system. Your app answers passkey and numeric-comparison requests itself, and bonds stay on the Dongl.

No. The free Dongl firmware runs on a Nordic nRF52840 Dongle or DK for prototyping, testing, and non-commercial validation. Dongl hardware ships with the firmware installed and includes a commercial license to use SimpleBLE through the Dongl backend.

SimpleBLE is source-available under the Business Source License 1.1 and free for non-commercial use. Evaluation needs no license. Commercial use needs a license, and one agreement covers your whole company, with no per-seat, per-device, or royalty fees. Each Dongl hardware unit includes a commercial license to use SimpleBLE through the Dongl backend.