Commit graph

250 commits

Author SHA1 Message Date
deadprogram
a668e1b0a0 all: release 0.10
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-06-18 13:23:46 +02:00
deadprogram
b1081a9db1 docs: add mention of support for rp2040-W to README
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-06-11 10:06:22 +02:00
deadprogram
0d0c149a20 modules: update for cyw43439 HCI functionality
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-06-11 10:06:22 +02:00
deadprogram
457af7571a cyw43439: HCI implementation
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-06-11 10:06:22 +02:00
deadprogram
9905abd00e test: add hci_uart based implementation to smoke tests
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-06-07 08:41:27 +02:00
deadprogram
926aeb43f6 hci: refactor to separate HCI transport implementation from interface to not always assume UART.
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-06-07 08:41:27 +02:00
Carter Melnychuk
d46f2cc206
fix: assign char handle write event (#274) 2024-05-29 22:01:47 +02:00
Ayke van Laethem
c26c9d5630 gap: fix ServiceDataElement.UUID comment
I can't find anything that says the service UUID can also be a company
UUID (though the UUID number ranges don't overlap, so it could be
possible). Maybe I'm wrong, considering the size of the Bluetooth
specification I could easily have missed something.
2024-05-25 17:18:48 +02:00
Lars Gohr
abbb565ef0
Improve documentation of RSSI
Fixes https://github.com/tinygo-org/bluetooth/issues/272
2024-05-21 21:04:24 +02:00
Jagoba Gascón
348de057f8 winrt-go: bump to latest
This version fixes an error that leaked Go pointers to the WinRT runtime
causing random access violation errors (0xc0000005) whenver these
pointers where freed or moved by Go's GC. For more info checkout
saltosystems/winrt-go#94.

Diff:
45c2d7a623...4f7860a3bd
2024-05-10 11:36:17 +02:00
Carter Melnychuk
314ca89209
Winrt full support (#266)
windows: full functionality
2024-05-09 18:34:24 +02:00
Elara
6b08161955 Add Address field to Windows Device struct 2024-04-24 19:53:59 +02:00
deadprogram
12b6f0bc25 Prepare for release 0.9.0
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-03-24 18:30:45 +01:00
Jagoba Gascón
52c3c068e2 winrt: bump to latest
The latest version of winrt-go fixes an error that could cause function
name collisions for static methods. Diff:
43a71786fb...a2e4fc03f5
2024-03-21 20:00:59 +01:00
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
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
deadprogram
d82232b16d modules: update to latest winrt-go package
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-02-21 12:20:19 +01:00
deadprogram
9a53d2a327 hci: implement Characteristic WriteHandler
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-02-02 00:01:51 -05:00
deadprogram
3e90718eb8 hci: multiple connections
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-02-01 22:03:41 -05:00
deadprogram
553633e56a examples: tinyscan to replace clue-scanner, also works on pyportal and pybadge+airlift
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-02-01 08:58:59 +01:00
deadprogram
b6fde65fd6 hci: return service UUIDs with scan results
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-27 00:16:09 -05:00
deadprogram
8e8dd34fc2 hci: allow for both ninafw and pure hci uart adapter implementations
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-26 07:31:00 -05:00
deadprogram
07a9e1d02e hci: several improvements and fixes including:
- 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

Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-23 21:38:07 -05:00
deadprogram
0a9bffe397 ninafw: should support muliple connections as a central
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-23 21:38:07 -05:00
deadprogram
00a475adf1 hci: add check for poll buffer overflow
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-23 21:38:07 -05:00
deadprogram
4c90cf4ab6 sd: replace unsafe.SliceData call with expression that is still supported in older Go versions
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-22 18:24:47 +01:00
deadprogram
bf647ecd57 ninafw: this PR contains several fixes and improvements for the NINAFW implementation including:
- 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

Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-17 10:21:32 +01:00
deadprogram
564b0ba58f all: use 'debug' variable protected by build tags for debug logging
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-16 17:25:37 +01:00
deadprogram
dc7d1b4d4c build: add nina-fw smoketest as peripheral
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-15 22:57:46 -05:00
deadprogram
5c62ee4645 docs: complete README info about nina-fw support
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-15 22:57:46 -05:00
deadprogram
10d1c71078 ninafw: implement BLE peripheral support
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-15 22:57:46 -05:00
Ayke van Laethem
b8c79250c7 softdevice: add support for connection timeout on connect
This adds support for the "connection supervision timeout", basically
the connection timeout while the connection is active (as opposed to
while connecting).
2024-01-12 14:56:32 +01:00
Ayke van Laethem
ecf09759ac softdevice: fix connect timeout
This fixes the connection timeout. Previously it would try to connect
for a time 16 times as much as specified by the user.
2024-01-12 14:56:32 +01:00
Ayke van Laethem
3f8f8a6622 softdevice: return an error on a connection timeout
This makes sure an error is reported on a connection timeout. Previously
it would just block forever.
2024-01-12 14:56:32 +01:00
Ayke van Laethem
d74f6a1009 all: add RequestConnectionParams to request new connection parameters
This allows changing the connection latency, slave latency, and
connection timeout of an active connection - whether in the central or
peripheral role. This is especially helpful on battery operated BLE
devices that don't have a lot of power and need to lower the connection
latency for improved speed. It might also be useful for devices that
need high speed, as the defaults might be too low.
2024-01-11 15:53:20 +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
Ayke van Laethem
c9eafaff20 all: make Device a value instead of a pointer
This is a refactor that is necessary to make it easier to work with
connected central devices on a SoftDevice.
2024-01-11 15:53:20 +01:00
Ayke van Laethem
6e0df0ec3c softdevice: add address of connecting device
I thought it wasn't available, but in fact it is. So let's make it
available in the connect handler.
2024-01-11 15:53:20 +01:00
Ayke van Laethem
735333aa1a softdevice: print connection parameters when debug is enabled
This is very useful for debugging, though we should probably expose this
in some way to users of the bluetooth package without changing a
constant.
2024-01-11 15:53:20 +01:00
deadprogram
56e56f3647 build: add arduino-nano33 and pyportal to smoke tests
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-07 08:59:59 +01:00
deadprogram
f639d80012 ninafw: add support for software RTS/CTS flow control for boards where hardware support is not available
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-07 08:59:59 +01:00
Ayke van Laethem
cd3c0c4835 linux: fix characteristic value
I left in a debugging value. Oops. Let's fix that quickly.
2024-01-06 15:49:26 +01:00
deadprogram
c5ab6a9b65 ninafw: use NINA settings from board file in main TinyGo repo
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-05 20:09:54 +01:00
Ayke van Laethem
eb30760e41 ninafw: fix connection timeout
The break statement didn't actually break the for loop, it just exited
the switch case.

Discovered because VS Code flagged the code after the loop as dead code.
2024-01-05 18:13:33 +01:00
Fabianexe
190c4be423
darwin: add Write command to the gattc implementation 2024-01-05 14:03:30 +01:00
Ayke van Laethem
5746ccfb60 all: don't use a pointer receiver for many method calls
This is unnecessary because the values are passed by value in other
cases, and can in some cases lead to more (heap or stack) allocation
than is necessary.
2024-01-04 20:43:16 +01:00
Anton Onipko
83fba1b809
Release AsyncOperationCompletedHandler (#208)
windows: release AsyncOperationCompletedHandler
2024-01-04 20:28:49 +01:00
deadprogram
b8a4a54d5f build: add some ninafw examples to smoketest
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-04 14:35:20 +01:00
deadprogram
30138095e1 ninafw: implement GetMTU()
Signed-off-by: deadprogram <ron@hybridgroup.com>
2024-01-04 14:35:20 +01:00