Cross-platform Bluetooth API for Go and TinyGo. Supports Linux, macOS, Windows, and bare metal using Nordic SoftDevice or HCI
Find a file
Ayke van Laethem d715f7d4df
Support BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST
This is generated by BlueZ (or Chromium?) and by some Android devices
(but not on my Android device for some reason). We currently default to
the lowest possible MTU for ease of implementing, but could perhaps
support a larger MTU in the future.
2020-05-25 16:56:36 +02:00
.circleci Add smoke tests that run in CI 2020-05-24 19:19:37 +02:00
examples Add smoke tests that run in CI 2020-05-24 19:19:37 +02:00
s132_nrf52_6.1.1 Initial commit 2019-11-08 10:58:02 +01:00
s140_nrf52_7.0.1 Port current codebase to S140 softdevice 2020-03-06 14:24:50 +01:00
.gitattributes Initial commit 2019-11-08 10:58:02 +01:00
.gitignore Add smoke tests that run in CI 2020-05-24 19:19:37 +02:00
adapter.go gap: implement basic event handling: connect/disconnect 2019-11-09 13:50:00 +01:00
adapter_linux.go Add Linux support 2019-11-09 17:55:19 +01:00
adapter_s132.c softdevice: make code more flexible for other SoftDevices 2020-03-06 13:46:42 +01:00
adapter_s132.go softdevice: make code more flexible for other SoftDevices 2020-03-06 13:46:42 +01:00
adapter_s140.c Port current codebase to S140 softdevice 2020-03-06 14:24:50 +01:00
adapter_s140.go Port current codebase to S140 softdevice 2020-03-06 14:24:50 +01:00
adapter_sd.go Support BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST 2020-05-25 16:56:36 +02:00
error_sd.go softdevice: make code more flexible for other SoftDevices 2020-03-06 13:46:42 +01:00
gap.go Add Linux support 2019-11-09 17:55:19 +01:00
gap_linux.go Add Linux support 2019-11-09 17:55:19 +01:00
gap_sd.go softdevice: make code more flexible for other SoftDevices 2020-03-06 13:46:42 +01:00
gatts.go gatts: implement write event for characteristics 2019-11-09 13:55:34 +01:00
gatts_linux.go Add Go module support 2020-05-25 00:10:28 +02:00
gatts_sd.go softdevice: make code more flexible for other SoftDevices 2020-03-06 13:46:42 +01:00
go.mod Add Go module support 2020-05-25 00:10:28 +02:00
go.sum Add Go module support 2020-05-25 00:10:28 +02:00
LICENSE Initial commit 2019-11-08 10:58:02 +01:00
Makefile Add smoke tests that run in CI 2020-05-24 19:19:37 +02:00
README.md Add smoke tests that run in CI 2020-05-24 19:19:37 +02:00
uuid.go linux: add support for services 2019-11-16 19:11:59 +00:00
uuid_sd.go softdevice: make code more flexible for other SoftDevices 2020-03-06 13:46:42 +01:00
uuid_test.go linux: add support for services 2019-11-16 19:11:59 +00:00

Go Bluetooth

CircleCI

Bluetooth API for embedded devices.

This package attempts to build a cross-system Bluetooth API written in Go. It specifically targets embedded devices that are supported by TinyGo.

At the moment, there is only support for the S132 SoftDevice (binary driver) on Nordic Semiconductors devices.

Flashing the SoftDevice

Flashing the SoftDevice can be tricky. If you have nrfjprog installed, you can erase the flash and flash the new BLE firmware using the following commands.

nrfjprog -f nrf52 --eraseall
nrfjprog -f nrf52 --program s132_nrf52_6.1.1/s132_nrf52_6.1.1_softdevice.hex

After that, don't reset the board but instead flash a new program to it. For example, you can flash the Heart Rate Sensor example using tinygo:

tinygo flash -target=pca10040-s132v6 ./examples/heartrate