Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tinygo-org/bluetooth
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.5.0
Choose a base ref
...
head repository: tinygo-org/bluetooth
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: release
Choose a head ref
Loading
Showing with 9,888 additions and 2,732 deletions.
  1. +0 −48 .circleci/config.yml
  2. +30 −0 .github/workflows/linux.yml
  3. +43 −0 .github/workflows/macos.yml
  4. +24 −0 .github/workflows/windows.yml
  5. +3 −0 .gitmodules
  6. +226 −0 CHANGELOG.md
  7. +5 −0 CONTRIBUTING.md
  8. +1 −1 LICENSE
  9. +24 −1 Makefile
  10. +76 −24 README.md
  11. +1 −4 adapter.go
  12. +116 −0 adapter_cyw43439.go
  13. +50 −5 adapter_darwin.go
  14. +219 −0 adapter_hci.go
  15. +122 −0 adapter_hci_uart.go
  16. +37 −18 adapter_linux.go
  17. +134 −0 adapter_ninafw.go
  18. +21 −10 adapter_nrf51.go
  19. +47 −14 adapter_nrf528xx-full.go
  20. +21 −9 adapter_nrf528xx-peripheral.go
  21. +10 −7 adapter_nrf528xx.go
  22. +0 −11 adapter_s110.c
  23. +0 −1 adapter_s110.go
  24. +0 −22 adapter_s113v7.c
  25. +3 −1 adapter_s113v7.go
  26. +0 −22 adapter_s132.c
  27. +3 −1 adapter_s132.go
  28. +0 −22 adapter_s140v6.c
  29. +3 −1 adapter_s140v6.go
  30. +0 −22 adapter_s140v7.c
  31. +3 −1 adapter_s140v7.go
  32. +48 −9 adapter_sd.go
  33. +43 −4 adapter_windows.go
  34. +1,220 −0 att_hci.go
  35. +1 −0 bluetooth-numbers-database
  36. +0 −1 bluetooth.go
  37. +1,662 −632 characteristic_uuids.go
  38. +0 −351 data/characteristic_uuids.json
  39. +0 −77 data/service_uuids.json
  40. +5 −0 debug.go
  41. +33 −29 error_sd.go
  42. +3 −0 examples/advertisement/main.go
  43. +64 −0 examples/battery/main.go
  44. +59 −0 examples/beacon/main.go
  45. +2 −3 examples/circuitplay/main.go
  46. +0 −87 examples/clue-scanner/main.go
  47. +84 −0 examples/connparams/main.go
  48. +95 −0 examples/device-information/main.go
  49. +9 −4 examples/discover/main.go
  50. +8 −4 examples/discover/mcu.go
  51. +1 −1 examples/discover/os.go
  52. +8 −4 examples/heartrate-monitor/main.go
  53. +8 −4 examples/heartrate-monitor/mcu.go
  54. +1 −1 examples/heartrate-monitor/os.go
  55. +22 −4 examples/heartrate/main.go
  56. +1 −1 examples/ledcolor/main.go
  57. +53 −0 examples/stop-advertisement/main.go
  58. +25 −0 examples/tinyscan/badger2040w.go
  59. +25 −0 examples/tinyscan/clue.go
  60. +57 −0 examples/tinyscan/main.go
  61. +25 −0 examples/tinyscan/pybadge.go
  62. +25 −0 examples/tinyscan/pyportal.go
  63. +237 −27 gap.go
  64. +107 −35 gap_darwin.go
  65. +621 −0 gap_hci.go
  66. +256 −88 gap_linux.go
  67. +43 −10 gap_nrf51.go
  68. +38 −10 gap_nrf528xx-advertisement.go
  69. +71 −39 gap_nrf528xx-central.go
  70. +15 −0 gap_sd.go
  71. +133 −0 gap_test.go
  72. +333 −28 gap_windows.go
  73. +86 −32 gattc_darwin.go
  74. +333 −0 gattc_hci.go
  75. +143 −85 gattc_linux.go
  76. +32 −31 gattc_sd.go
  77. +469 −0 gattc_windows.go
  78. +13 −1 gatts.go
  79. +128 −0 gatts_hci.go
  80. +123 −61 gatts_linux.go
  81. +1 −2 gatts_other.go
  82. +38 −29 gatts_sd.go
  83. +309 −0 gatts_windows.go
  84. +20 −8 go.mod
  85. +37 −73 go.sum
  86. +833 −0 hci.go
  87. +27 −0 hci_cyw43439.go
  88. +155 −0 l2cap_hci.go
  89. +5 −0 nodebug.go
  90. +4 −4 rawterm/hosted.go
  91. +4 −4 rawterm/nrf.go
  92. +286 −117 service_uuids.go
  93. +36 −8 tools/gen-characteristic-uuids/main.go
  94. +36 −5 tools/gen-service-uuids/main.go
  95. +50 −9 uuid.go
  96. +0 −18 uuid16.go
  97. +0 −15 uuid16_darwin.go
  98. +20 −0 uuid_hci.go
  99. +3 −8 uuid_sd.go
  100. +33 −0 uuid_test.go
  101. +1 −1 version.go
  102. +0 −250 winbt/advertisement.go
  103. +0 −56 winbt/event.c
  104. +0 −82 winbt/event.go
  105. +0 −73 winbt/vector.go
  106. +0 −62 winbt/winbt.go
48 changes: 0 additions & 48 deletions .circleci/config.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Linux

on:
pull_request:
push:
branches:
- dev
- release
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
container: ghcr.io/tinygo-org/tinygo-dev
steps:
- name: Work around CVE-2022-24765
# We're not on a multi-user machine, so this is safe.
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Checkout
uses: actions/checkout@v3
- name: TinyGo version check
run: tinygo version
- name: Run unit tests
run: go test
- name: Run TinyGo smoke tests
run: make smoketest-tinygo
- name: Run Linux smoke tests
run: make smoketest-linux
- name: "Run Windows cross-compiled smoke tests"
run: make smoketest-windows
43 changes: 43 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: macOS

on:
pull_request:
push:
branches:
- dev
- release

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
macos-13:
name: macos-13
runs-on: macos-13
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Checkout
uses: actions/checkout@v4
- name: Run unit tests
run: go test
- name: "Run macOS smoke tests"
run: make smoketest-macos

macos-14:
name: macos-14
runs-on: macos-14
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Checkout
uses: actions/checkout@v4
- name: Run unit tests
run: go test
- name: "Run macOS smoke tests"
run: make smoketest-macos
24 changes: 24 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Windows

on:
pull_request:
push:
branches:
- dev
- release

jobs:
build-windows:
name: build-windows
runs-on: windows-2022
steps:
- name: Install Go
uses: actions/setup-go@v4.1.0
with:
go-version: '1.21.0'
- name: Checkout
uses: actions/checkout@v3.6.0
- name: Run unit tests
run: go test
- name: "Run Windows smoke tests"
run: make smoketest-windows
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "bluetooth-numbers-database"]
path = bluetooth-numbers-database
url = https://github.com/NordicSemiconductor/bluetooth-numbers-database.git
226 changes: 226 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,229 @@
0.11.0
---
* **core**
- gap: do not add ADFlags to advertising data for AdvertisingTypeNonConnInd, to leave room for FindMy data
- gap: make generic services function for HCI separate function
- update to latest version of Bluetooth numbers database for latest services/characteristics
* **linux**
- gap: add implementation for SetRandomAddress() function
- gap: correct HCI implementation so it can Configure/Start/Stop advertising correctly. Needed to update ServiceData after Advertisment is already started.
- gap: update implementation for GAP to allow for calling adv.Configure() followed by adv.Start() followed by adv.Stop() multiple times. This is required in order to update advertising ServiceData.
- fix: close signal on Connect for Linux platform to address issues raised in #262
- reconnect connect/disconnect handlers centrals
- Allow users to choose between different adapters
- Issue #311 Clean resources properly when disable notifications
* **hci**
- add advertiser support for ManufacturerData and ServiceData
- contains several corrections needed for HCI on both ninafw and cyw43439
- implement set random MAC address
- store local address as MACAddress
- use current MAC address when Advertiser, allowing support for random advertiser addresses
- when advertising, do not send ADFlags if we are using AdvertisingTypeNonConnInd
- implement connect handler for Advertiser for HCI
- fix bluetooth initialization on cyw43439
- actually parse of ServiceData and ManufacturerData when scanning, and use existing GAP implementation to do it
- correct parsing of ServiceData and ManufacturerData and add some helpful constants
- correct race condition from connection params in HCI implementation. Basically it was responding by calling a function that retriggered asking to change the parameters yet again. Yet we are not actually doing anything about this request at present.
- ensure HCI send/receive buffers for ATT are large enough for maximum MTU length
- ensure that HCI advertising interval is set to a default value, otherwise different adverting types do not work correctly
- reconnect connect/disconnect handlers for centrals
- fix: set HCI default Advertising Interval to a more sensible default
- enable setting MACAddr for cyw43439
* **nordic semi**
- nrf51: add SetRandomAddress() function when Advertisment
- nrf528xx: add SetRandomAddress() function when Advertiser
- nrf528xx: correctly use the passed Advertising options type as the type passed into the SoftDevice struct for API call
update the EnableNotifications Method, add the parameter to specifing… (#293)
* **windows**
- gap/windows: add stubbed function for SetRandomAddress()
- reconnect connect/disconnect handlers for centrals
* **examples**
- add example showing how to create a peripheral using the Battery Service
- add example showing how to create a peripheral using the Device Information Service
- add example to broadcast advertising servicedata
- improve heartrate examples by adding all of the required characteristics for it to fulfill the complete heart rate profile in the spec.
- refactor tinyscan to use tinyterm/displays package and also add badger2040-w
* **build**
- remove macOS 11 build since it has been removed, and run macOS 14 instead (#285)
- remove macOS 12 runner
* **docs**
- update README to include Windows CI badge and correctly updated info about current capabilities
- update README with some links and clarifications
- license: update year to 2025


0.10.0
---

* **core**
- gap: fix ServiceDataElement.UUID comment
* **docs**
- add mention of support for rp2040-W to README
- Improve documentation of RSSI Fixes https://github.com/tinygo-org/bluetooth/issues/272
* **hci**
- cyw43439: HCI implementation
- refactor to separate HCI transport implementation from interface to not always assume UART.
- update for cyw43439 HCI functionality
* **windows**
- Add Address field to Windows Device struct
- Winrt full support (#266)
- winrt-go: bump to latest
- assign char handle write event (#274)
* **test**
- add hci_uart based implementation to smoke tests

0.9.0
---

* **build**
- add arduino-nano33 and pyportal to smoke tests
- add nina-fw smoketest as peripheral
- add some ninafw examples to smoketest
* **core**
- add ServiceData advertising element (#243)
- add RequestConnectionParams to request new connection parameters
- change ManufacturerData from a map to a slice
- don't use a pointer receiver for many method calls
- make Device a value instead of a pointer
- use 'debug' variable protected by build tags for debug logging
- use Device instead of Address in SetConnectHandler
* **docs**
- a small mention of the NINA BLE support
- complete README info about nina-fw support
* **linux**
- fix characteristic value
- rewrite everything to use DBus directly
* **macos**
- add Write command to the gattc implementation
* **examples**
- tinyscan to replace clue-scanner, also works on pyportal and pybadge+airlift
- update MCU central examples to use ldflags to pass the desired device to connect to
- discover: add MTU
* **hci**
- add check for poll buffer overflow
- allow for both ninafw and pure hci uart adapter implementations
- implement Characteristic WriteHandler
- multiple connections
- return service UUIDs with scan results
- add l2cap signaling support
- implement evtNumCompPkts to count in-flight packets
- correct implementation for WriteWithoutReponse
- speed up time waiting for hardware - corrections to MTU exchange
- add support for software RTS/CTS flow control for boards where hardware support is not available
- BLE central implementation on nina-fw co-processors
- fix connection timeout
- implement BLE peripheral support
- implement GetMTU()
- remove some pointer receivers from method calls
- should support muliple connections as a central
- correctly return from read requests instead of returning spurious error
- move some steps previously being done during Configure() into Start() where they more correctly belonged.
- use advertising display name as the correct default value for the generic access characteristic.
- speed up the polling for new notifications for Centrals
- use NINA settings from board file in main TinyGo repo
* **nordic semi**
- replace unsafe.SliceData call with expression that is still supported in older Go versions
- update to prepare for changes in the TinyGo CGo implementation
- add address of connecting device
- add support for connection timeout on connect
- don't send a notify/indicate without a CCCD
- fix connect timeout
- fix writing to a characteristic
- print connection parameters when debug is enabled
- return an error on a connection timeout
* **windows**
- Release AsyncOperationCompletedHandler (#208)
- check for error when scanning
- bump to latest winrt


0.8.0
---

* **build**
- remove CGo dependencies for Windows cross-compiler tests
- add Windows to GH actions build jobs
- add macOS 12 to GH actions build jobs
* **core**
- go 1.18 and remove old-style build tags
- Noescape workaround
* **docs**
- update README to remove CGo requirement for Windows
- add documentation to heartrate-monitor
* **linux**
- Added option to add ManufacturerData to Advertisement
* **macos**
- enable support for duplicate chars by moving from a map to a slice
* **examples**
- Include WriteWithoutResponse permission, for examples, where Write exists
* **nordic semi**
- softdevice: added manufacturer data support
- softdevice: test creation of raw BLE advertisement packets
* **windows**
- update github.com/saltosystems/winrt-go to no longer require CGo


0.7.0
---

* **build**
- switch to ghcr.io for docker container
- update to actions/checkout@v3
- work around for CVE-2022-24765
* **core**
- gap: Set and SetRandom methods should have a pointer receiver
- mtu-{darwin,linux,windows,sd}: add get mtu function
- remove Addresser
- update uuid generation
* **docs**
- CONTRIBUTING: add note on new APIs
- correct badge link for GH actions
- README: add note on macOS Big Sur and iTerm2
* **linux**
- do not randomize order of returned discovered services/chars
- fix characteristic scan order
- implement disconnect handling
* **macos**
- implement disconnect handling
- fix characteristic scan order
* **examples**
- add examples/stop-advertisement
* **nordic semi**
- nrf528xx: handle BLE_GAP_EVT_PHY_UPDATE_REQUEST and explicitly ignore some other events
- softdevice: avoid a heap allocation in the SoftDevice event handler
* **windows**
- Added Indicate support to Windows driver
- gap/windows: Scan should set scanning mode to active to match other platforms
- support empty manufacturer data
- winrt-go: bump to latest


0.6.0
---
* **core**
- unify UUID16 creation for all platforms
- Improve UUID (#107)
- gap: stop advertising
- advertising: add manufacturer data field to advertisement payload
* **linux**
- gap: workaround for https://github.com/muka/go-bluetooth/issues/163
- update to latest muka/go-bluetooth
* **windows**
- add characteristic read, write and notify operations
- add characteristic discovery
- add service discovery
- add device connection and disconnection
- add winrt-go dependency and remove manually generated code
- disable cache when reading characteristics
* **macos**
- update to tinygo-org fork of cbgo v0.0.4
- use the same UUID format as expected by other standard
* **docs**
- update README with info on Windows support
* **build**
- add Github Action based CI build (#108)


0.5.0
---
* **core**
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -18,6 +18,11 @@ We probably have not implemented it yet. Your pull request adding the functional

Please open a Github issue. We want to help, and also make sure that there is no duplications of efforts. Sometimes what you need is already being worked on by someone else.

If your contribution includes a new API (one that does not exist yet for any BLE stack), please make sure it is portable:

* Ideally, add support for it to two different Bluetooth APIs at the same time, for example CoreBluetooth and BlueZ.
* If you are unable to do so, please explain (with links to documentation!) why this feature also fits a different API.

## How to use our Github repository

The `release` branch of this repo will always have the latest released version of the Go Bluetooth module. All of the active development work for the next release will take place in the `dev` branch. The Go Bluetooth module will use semantic versioning and will create a tag/release for each release.
Loading