BLE Central Gateway

With the first Beta of DeviceOS 3.0 now available, there are several improvements to BLE for Gen3 products. One common use case for using the Boron or the Tracker is to use it as a Gateway for BLE peripherals. With that in mind, here’s a library I’ve been working on to simultaneously connect to different kinds of devices.

There are examples on using the library with the Tracker as well as with Boron/Argon.

Adding new peripheral types
One of the improvements in 3.0 is the ability to hierarchically search for BLE Characteristics inside Services. This library takes advantage of that by also building the peripherals in a hierarchical manner, and re-using Services and Characteristics if appropriate. The library supports peripherals that use UUIDs assigned by the Bluetooth SIG as well as ones that use custom UUIDs.

Pairing
Another improvement is the ability to pair with devices that require Legacy Pairing, whether with or without a passkey. Check out the “Handle Pairing” section of the library’s README to see how to do that.

3 Likes

Super! Gracias Mariano.

1 Like

I was thinking of trying to create a bike monitor for a Brompton electric bike - this has a battery pack which is BLE enabled and once paired has a load of information from the battery, motor and sensors such as speed, distance, battery level, range, power output; essentially all the things you might want to see but they can’t show on the LED UI. The search for BLE Characteristics inside services sounds useful.

1 Like

I was thinking of trying to create a bike monitor for a Brompton electric bike - this has a battery pack which is BLE enabled and once paired has a load of information from the battery, motor and sensors such as speed, distance, battery level, range, power output

That would certainly work, if you can get the specification of what the different bytes in each Characteristic mean. I assume they are using a custom Service, since there aren’t standard Services that cover all of the things you mention.