Commit graph

38 commits

Author SHA1 Message Date
Ayke van Laethem
852fa4ab6a windows: check for error when scanning
This was my attempt to figure out why scanning doesn't work on my
system. Sadly it still doesn't work, but at least I know there's no
error in this place.

(Note: I'm doing this on Windows ARM in a VM, so it's a rather special
setup).
2024-03-21 06:46:36 +01:00
deadprogram
d82232b16d modules: update to latest winrt-go package
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-02-21 12:20:19 +01:00
Ayke van Laethem
d77521461d linux: rewrite everything to use DBus directly
This is a big rewrite to use DBus calls directly instead of going
through go-bluetooth first.

This is a big change, but I believe it is an improvement. While the
go-bluetooth works for many cases, it's a layer in between that I
believe hurts more than it helps. Without it, we can just program
directly against the BlueZ D-Bus API. The end result is about 10% more
code.

With this rewrite, I fixed the following issues:

  * All MapToStruct warnings are gone, like in
    https://github.com/tinygo-org/bluetooth/issues/193.
  * Advertisements can be restarted after they were stopped. Previously
    this resulted in a panic.
  * Looking at the source code of go-bluetooth, it appears that it
    includes devices from a different Bluetooth adapter than the one
    that's currently scanning. This is fixed with the rewrite.
  * Fix a bug in Adapter.AddService where it would only allow adding a
    single service. Multiple services can now be added.
    This was actually the motivating bug that led me down to rewrite the
    whole thing because I couldn't figure out where the bug was in
    go-bluetooth (it's many layers deep).
  * The `WriteEvent` callback in a characteristic now also gets the
    'offset' parameter which wasn't provided by go-bluetooth.

This rewrite also avoids go-bluetooth specific workarounds like
https://github.com/tinygo-org/bluetooth/pull/74 and
https://github.com/tinygo-org/bluetooth/pull/121.

I have tested all examples in the smoketest-linux Makefile target. They
all still work with this rewrite.
2024-01-03 20:40:48 +01:00
Ayke van Laethem
01243181c3 sd: update to prepare for changes in the TinyGo CGo implementation
For details, see: https://github.com/tinygo-org/tinygo/pull/3927

I ran the smoke tests and the binaries are exactly identical to what
they were before, so this change cannot have had an effect on these
smoke tests (which is expected, as this is mostly just changing some
types without changing the machine data type).
2023-10-05 19:11:46 +02:00
deadprogram
1f58ec1fb4 windows: update github.com/saltosystems/winrt-go to no longer require CGo
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-09-21 12:54:07 +02:00
Erik de Vries
d9490f73ea Update dependencies - add documentation to heartrate-monitor 2023-08-11 12:49:03 +02:00
Yurii Soldak
f9436906c1 all: go 1.18 and remove old-style build tags 2023-07-31 15:54:58 +02:00
Jagoba Gascón
4d067bc2b3 winrt-go: bump to latest
This version fixes critical bugs that caused random errors at runtime.
For more details see saltosystems/winrt-go/issues#71 and
saltosystems/winrt-go/issues#72. Diff:
e096b9a...c792451
2023-06-14 08:42:31 +02:00
deadprogram
1c44c024fd modules: update to latest TinyGo drivers and friends
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-06-12 01:46:46 +02:00
A.J. Lucas
cf51caa6ad gap/windows: Scan should set scanning mode to active to match other platforms 2023-05-11 13:54:22 +02:00
Bram van Neerven
34cb58db57 update uuid generation 2023-01-29 23:54:12 +01:00
Jagoba Gascón
be99863ef5 winrt-go: bump to latest
The latest winrt-go version fixes an access violation error caused by
some Go pointers being referenced in non-Go memory. More info:
https://github.com/saltosystems/winrt-go/issues/63
2023-01-25 13:02:48 +01:00
Jagoba Gascón
d0178d95f6 mtu-{darwin,linux,windows,sd}: add get mtu function 2022-10-19 20:02:55 +02:00
deadprogram
792f4f079e all: update dependencies before release
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-10-02 10:55:07 +02:00
deadprogram
39e6a357ea linux: update to latest muka/go-bluetooth
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-09-29 10:49:08 +02:00
Jagoba Gascón Sánchez
8f13d06111 windows: add winrt-go dependency and remove manually generated code 2022-09-08 14:07:46 +02:00
deadprogram
7ec948bf3f macos: update to tinygo-org fork of cbgo v0.0.4
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-09-05 15:58:01 +02:00
deadprogram
0b701c55ca macos: use the same UUID format as expected by other standard
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-09-05 15:58:01 +02:00
deadprogram
cc5adf3789 macos: update to point to tinygo-org fork 2022-09-05 15:58:01 +02:00
deadprogram
e7671110ad linux: update to latest go-bluetooth package
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-05-22 14:39:13 +02:00
deadprogram
25d288fd10 all: update to drivers 0.20.0
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-04-29 11:53:23 +02:00
deadprogram
8cab553c59 all: update modules to use dev branch with TinyGo 0.23-pre compatible drivers
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-04-21 18:13:49 +02:00
deadprogram
899467bab3 modules: update muka/go-bluetooth to latest version
Signed-off-by: deadprogram <ron@hybridgroup.com>
2021-09-03 15:07:01 +02:00
deadprogram
d472af8a8e modules: add tinyterm package for clue example
Signed-off-by: deadprogram <ron@hybridgroup.com>
2021-07-21 22:18:58 +02:00
deadprogram
28f9f4e69e release: prepare for v0.3.0
Signed-off-by: deadprogram <ron@hybridgroup.com>
2021-03-06 14:05:08 +01:00
deadprogram
46364419f9 modules: update to latest TinyGo drivers package
Signed-off-by: deadprogram <ron@hybridgroup.com>
2021-02-14 13:21:12 +01:00
deadprogram
a355f254da linux: downgrade to older version of go-bluetooth that appears to work correctly with BlueZ 5.50
Signed-off-by: deadprogram <ron@hybridgroup.com>
2021-01-18 18:40:29 +01:00
deadprogram
2fb3b08920 modules: update to latest version of go-bluetooth package for Linux
Signed-off-by: deadprogram <ron@hybridgroup.com>
2020-10-03 19:46:46 +02:00
Ron Evans
6d20fc6472
examples: add example for Circuit Playground Bluefruit board to control built-in NeoPixels
Signed-off-by: deadprogram <ron@hybridgroup.com>
2020-09-10 15:24:22 +02:00
deadprogram
a55e2194c5 domain: use custom domain for all uses of winbt subpackage
Signed-off-by: deadprogram <ron@hybridgroup.com>
2020-09-09 16:04:40 +02:00
deadprogram
97532eaed4 domain: use custom domain for go.mod and examples
Signed-off-by: deadprogram <ron@hybridgroup.com>
2020-09-09 16:04:40 +02:00
Ron Evans
51b2b4c2b2 macos: starting point for adding macOS support
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2020-09-02 08:37:04 +02:00
Ayke van Laethem
602e656a6b
linux: improve scanning
By using the D-Bus APIs directly, I managed to avoid a deadlock that I
somehow couldn't work around with the go-bluetooth package.
2020-06-28 00:21:47 +02:00
Ayke van Laethem
b568c93250
all: add support for sending notifications
This is done by enabling the Notify permission and writing to the
characteristics: writes will automatically notify connected centrals.
2020-06-03 19:42:21 +02:00
Ayke van Laethem
37eb64b519
linux: implement local characteristics 2020-06-02 23:57:51 +02:00
Ayke van Laethem
518debbbfe
Move to github.com/tinygo-org/bluetooth 2020-05-31 16:45:26 +02:00
Ayke van Laethem
22553053ff Add initial Windows support
Only scanning has been implemented so far. The most work was really just
understanding WinRT well enough to get to this point.
2020-05-30 21:51:27 +02:00
Ayke van Laethem
44147f2a86
Add Go module support
This also updates the muka/go-bluetooth package (which required a few
changes).
2020-05-25 00:10:28 +02:00