TinyGo Bluetooth
On Linux, NewAdapter selects a BlueZ adapter such as hci1. On Windows and macOS, only the default adapter is available, and selecting a secondary one is an open issue.

Go Bluetooth
Dongl is a USB Bluetooth Low Energy adapter you drive from Go with SimpleGoBLE. Scan, connect, and pair through its own radio on Windows, macOS, and Linux, with no cgo and no C compiler.
















































Pre-order a Dongl, or flash the free Dongl firmware onto a Nordic nRF52840 Dongle or DK you already own.
Run go get github.com/simpleble/simplegoble.
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 ble "github.com/simpleble/simplegoble"
dongl, err := ble.GetDonglBackend()
if err != nil {
return err
}
defer dongl.Close()
adapters, err := dongl.Adapters() // Close each adapter when finished.
if err != nil {
return err
}
if len(adapters) == 0 {
return errors.New("no Dongl found")
}
adapter := adapters[0]
name, _ := adapter.Identifier()
address, _ := adapter.Address()
fmt.Println(name, address)Go's BLE packages reach a second adapter on Linux. On Windows and macOS, they use the computer's default radio.
On Linux, NewAdapter selects a BlueZ adapter such as hci1. On Windows and macOS, only the default adapter is available, and selecting a secondary one is an open issue.
go-ble selects an HCI device by number on Linux. Its README notes that the macOS portion is not actively maintained, and it does not run on Windows.
go-bluetooth wrapped BlueZ over D-Bus on Linux. Its repository is archived.
go get and go build. The native library comes with the module, and Dongl support with it.
Each Dongl is another adapter with its own radio. Drive each from its own goroutine to test devices in parallel.
Scans report each device's real address, so a Mac test station matches devices by the address on their label.
Your code answers passkey and numeric-comparison prompts, with no system dialog. Bonds stay on the Dongl.
The same Go program drives a Dongl on all three desktops, and in a Docker container on Linux.
Commercial customers work directly with the team that builds SimpleBLE and the Dongl firmware.
Dongl hardware ships with the firmware installed and includes a commercial license to use SimpleBLE through the Dongl backend.
Plug in a Dongl, add SimpleGoBLE with go get, and take the adapters of the Dongl backend with ble.GetDonglBackend(). Each Dongl is an adapter with its own radio, and it works through the same API as the computer's Bluetooth.
Plug in a Dongl, add SimpleGoBLE with go get, and take the adapters of the Dongl backend with ble.GetDonglBackend(). Each Dongl is an adapter with its own radio, and it works through the same API as the computer's Bluetooth.
No. SimpleGoBLE carries the native SimpleBLE library for each platform and loads it without cgo, so no C compiler is needed to build your program.
No. SimpleGoBLE carries the native SimpleBLE library for each platform and loads it without cgo, so no C compiler is needed to build your program.
Yes. Each Dongl is a separate adapter with its own address, stable across restarts and USB ports. Drive each one from its own goroutine to scan, connect, and read in parallel.
Yes. Each Dongl is a separate adapter with its own address, stable across restarts and USB ports. Drive each one from its own goroutine to scan, connect, and read in parallel.
On Linux, yes. The Dongl needs only a USB port, so it works without BlueZ running, such as inside a Docker container with the Dongl passed through.
On Linux, yes. The Dongl needs only a USB port, so it works without BlueZ running, such as inside a Docker container with the Dongl passed through.
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.
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.
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.