examples: add example that makes connections to multiple peripherals
This PR adds a new example that makes connections to multiple peripherals.
It has been tested and is known to be working on Linux and on HCI with NINAFW, as long as #317 has been merged first.
On Linux I tested with 6 simultaneous connections. It might allow more. On HCI I tested with 3 simultaneous connects. Again, more might also work.
What is the main purpose of the example? Show it is possible to connect to several peripherals and subscribe to notifications from them? If so, I find all this dance with specifying device addresses unnecessary -- it just bloats the example code. Can we instead just subscribe to any HR bluetooth device we can find? Simplifies code and makes it easier to try out.
I've tried to see if it works with SoftDevice (xiao-ble) and it does not seem to do.
$ tinygo flash -target xiao-ble -ldflags="-X main.Devices=84:CC:A8:2E:C1:CE,84:CC:A8:79:12:F6" -monitor ./examples/multiples/
connected to 84:CC:A8:2E:C1:CE
connected to 84:CC:A8:79:12:F6
discovering services/characteristics
It is stuck here ☝️
Two heart rate boards are Nano-RP2040, flashed like this:
tinygo flash -target=nano-rp2040 --size=short ./examples/heartrate