d77521461d
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.
22 lines
581 B
Modula-2
22 lines
581 B
Modula-2
module tinygo.org/x/bluetooth
|
|
|
|
go 1.18
|
|
|
|
require (
|
|
github.com/go-ole/go-ole v1.2.6
|
|
github.com/godbus/dbus/v5 v5.1.0
|
|
github.com/saltosystems/winrt-go v0.0.0-20230921082907-2ab5b7d431e1
|
|
github.com/tinygo-org/cbgo v0.0.4
|
|
golang.org/x/crypto v0.12.0
|
|
tinygo.org/x/drivers v0.26.1-0.20230922160320-ed51435c2ef6
|
|
tinygo.org/x/tinyfont v0.4.0
|
|
tinygo.org/x/tinyterm v0.3.0
|
|
)
|
|
|
|
require (
|
|
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
|
|
github.com/sirupsen/logrus v1.9.3 // indirect
|
|
golang.org/x/sys v0.11.0 // indirect
|
|
golang.org/x/term v0.11.0 // indirect
|
|
)
|