Commit graph

17 commits

Author SHA1 Message Date
dnlwgnd
e0d5fd4c3a
add ServiceData advertising element (#243)
* gap: fix comment

* gap: expose ServiceData() in AdvertisementFields

* macos: include ServiceData in AdvertisementFields

* gap/linux: include ServiceData in AdvertisementFields

* gap: add unimplemented ServiceData() to raw advertisement

* added ServiceData advertising element also to the sending pieces

* more explicitly use the ad element type ids

* added a test case for ServiceData

* linux: added ServiceData advertising element

* sd: fix: handle no servicedata present

* linux: bluez uses string uuids for service data

* linux: fix: correct datatype for advertise with ServiceData

* uuid: add 32-Bit functions

* ServiceData now also uses a slice instead of a map as in #244

* Revert unnessesary changes

* formatting

* remove extra check

---------

Co-authored-by: William Johansson <radar@radhuset.org>
2024-03-18 22:15:09 +01:00
Ayke van Laethem
0087e0549b all: change ManufacturerData from a map to a slice
This is a breaking change, but I believe it is necessary for
correctness. Because maps have an undefined iteration order, the actual
advertised packet could change each time which I think is a bad thing.
In addition to that, using a slice should be much more lightweight than
using a map.

I've also added some tests (that should have been there in the first
place) and added some manufacturer data to the advertisement example.

Furthermore, I've optimized the code that constructs manufacturer data
for raw advertisement payloads, it should now be entirely free of heap
allocations.
2024-02-21 12:39:24 +01:00
Ayke van Laethem
5d805a929c all: use Device instead of Address in SetConnectHandler
This makes it possible to discover services on a connected central while
in peripheral mode, for example.
2024-01-11 15:53:20 +01:00
Baden Parr
3523e14bfc macos: implement disconnect handeling
macos: add disconnect handler

macos: add default timeout and params.ConnectionTimeout handling


macos: add central manager CancelConnect call on connection timeout


macos: added address to connectHanndler call upon successful connection


macos: remove printing error on peripheral disconnection


macos: move and rename default connection timeout


macos: wait for disconnection upon timed out connection attempt
2023-05-04 14:02:39 +02:00
Ayke van Laethem
b06d666dbf all: remove Addresser
Remove the Addresser type. It isn't really necessary (the Address type
can change between OSes) and makes it difficult to fix a heap allocation
in interrupts (on the Nordic SoftDevices).

This is a backwards incompatible change, but only programs that use
SetConnectHandler should notice this.
2023-04-26 23:37:36 +02:00
deadprogram
cc5adf3789 macos: update to point to tinygo-org fork 2022-09-05 15:58:01 +02:00
Jagoba Gascón
9b9512fbc9 advertising: add manufacturer data field to advertisement payload 2022-05-22 14:36:27 +02:00
Erik Price
cf63949412 darwin: make Adapter.Connect thread-safe
This change allows multiple concurrent goroutines to call
`Adapter.Connect` without racing.

Fixes #57
2021-07-21 00:09:35 +02:00
Ron Evans
0bc0ef868d adaptor/macos: handle case when adapter enable sends notification before event delegate is set
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2020-10-28 08:10:15 +01:00
Ron Evans
6dc1dff711
gap: add connection handler to be called on adapter connect/disconnect
Signed-off-by: deadprogram <ron@hybridgroup.com>
2020-09-10 17:17:45 +02:00
deadprogram
d570aa58a6 docs: better explanation of peripheral UUID on macOS
Signed-off-by: deadprogram <ron@hybridgroup.com>
2020-09-02 08:37:04 +02:00
Ron Evans
a7844e1734 macos: remove unneeded functions to export internal implementaions.
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2020-09-02 08:37:04 +02:00
Ron Evans
dc738f9c47 macos: able to discover services and characteristics for a device
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2020-09-02 08:37:04 +02:00
Ron Evans
5f44bb4a96 macos: completed initial implementation
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2020-09-02 08:37:04 +02:00
Ron Evans
c1114ad708 all: use Addresser interface to handle fact that macOS uses UUID instead of MAC as the BLE address for a peripheral
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2020-09-02 08:37:04 +02:00
Ron Evans
a620bacdb8 macos: able to retrieve some of the info when scanning
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2020-09-02 08:37:04 +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