Commit graph

13 commits

Author SHA1 Message Date
Yurii Soldak
f9436906c1 all: go 1.18 and remove old-style build tags 2023-07-31 15:54:58 +02:00
Sebastien Binet
f844306136 linux: properly close goroutines started by EnableNotifications
Fixes #168.

Signed-off-by: Sebastien Binet <binet@cern.ch>
2023-06-02 14:30:22 +02:00
Ayke van Laethem
8260f2fb93 linux: do not randomize order of returned discovered services/chars
Previously the list of services and characteristics wasn't sorted, and
because of the way Go maps work they were in fact randomized.
This commit fixes the sorting for services and characteristics, which
both suffered from the same lack of sorting.

This fixes https://github.com/tinygo-org/bluetooth/issues/135.
2023-05-07 12:38:34 +02:00
Ayke van Laethem
5717af56e0 linux: fix characteristic scan order
This is very much like https://github.com/tinygo-org/bluetooth/pull/161,
but for Linux instead. In fact, I've copied the structure of the code
because it works for macOS.

I have tested that the scan order is now as requested. I also verified
that multiple characteristics with the same UUID are now supported, but
support is still a bit buggy: they appear in a random order (due to Go
map iteration order). I will fix this in the next commit.
2023-05-07 12:38:34 +02:00
Jagoba Gascón
d0178d95f6 mtu-{darwin,linux,windows,sd}: add get mtu function 2022-10-19 20:02:55 +02:00
Ayke van Laethem
96a2be1571 Add //go:build lines for Go 1.18
This will be needed eventually, so add them now already.
2022-04-19 11:00:08 +02:00
David Barroso
bd75a42694 gattc/linux: DiscoverServices times out in 10s 2021-11-05 19:24:02 +01:00
Ron Evans
266de9824a
gattc/*: DeviceCharacteristic Read() implementation
Signed-off-by: deadprogram <ron@hybridgroup.com>
2020-10-22 19:04:47 +02:00
deadprogram
69aae6c6b9 gattc/linux: correct false positive error when using DiscoverServices with a specific list of UUID
Signed-off-by: deadprogram <ron@hybridgroup.com>
2020-09-16 13:22:09 +02:00
Ron Evans
ef90e5d337
gattc: use GetUUID() to allow for bare metal use of short UUID. (#14)
* gattc: use UUID() to allow for bare metal to permit clean use of short UUIDs

Signed-off-by: deadprogram <ron@hybridgroup.com>

* gattc/macos: correct usage of UUID wrapper type alias

Signed-off-by: Ron Evans <ron@hybridgroup.com>

* gattc/sd: correct usage of UUID wrapper type alias

Signed-off-by: Ron Evans <ron@hybridgroup.com>

* gattc/sd, uuid/sd: changes intended to reduce memory allocations for service and characteristic discovery

Signed-off-by: deadprogram <ron@hybridgroup.com>

* gattc/sd: partial improvements to DiscoverServices/DiscoverCharacteristics

Signed-off-by: deadprogram <ron@hybridgroup.com>

* gattc/sd: mostly getting uuid back for services in DiscoverServices

Signed-off-by: deadprogram <ron@hybridgroup.com>

* uuid/sd: correct way to calculate UUID from shortUUID

Signed-off-by: deadprogram <ron@hybridgroup.com>

* gattc/sd: able to discover services and characteristics

Signed-off-by: deadprogram <ron@hybridgroup.com>

* examples: updated discover example that can run with OS or bare metal

Signed-off-by: deadprogram <ron@hybridgroup.com>

* gattc/sd: ensure safe casts for length of returned struct when converting short UUID

Signed-off-by: deadprogram <ron@hybridgroup.com>
2020-09-13 20:21:38 +02:00
deadprogram
fd89ad24a8 linux: all for DiscoverServices and DiscoverCharacteristics to discover all when no specific list of UUIDs
Signed-off-by: deadprogram <ron@hybridgroup.com>
2020-09-03 15:26:43 +02:00
deadprogram
ac98835ed3 linux: add UUID to DeviceService and DeviceCharacteristic
Signed-off-by: deadprogram <ron@hybridgroup.com>
2020-09-03 15:26:43 +02:00
Ayke van Laethem
54cb2b25bb
linux: add GATT client support 2020-06-28 00:22:19 +02:00