danielgallagher0 / bluetooth-hci

Bluetooth HCI implementation for embedded Rust
Apache License 2.0
53 stars 8 forks source link

Add support for encoding LE advertisements #5

Closed micolous closed 1 year ago

micolous commented 1 year ago

This adds support for encoding Complete Local Name, Service Data and Manufacturer Data advertisements, and adds an enumeration of all "common data types" from the Bluetooth Assigned Numbers Registry.

This isn't a complete list of advertisement types; these are commonly seen on various types of beacons (eg: iBeacon, Eddystone, etc.)

I was able to use this to set up advertising on a Nordic nRF52832 running Apache MyNewt's BLEHCI example, which was connected to my computer with a USB TTL serial adapter:

https://github.com/micolous/serialport-hci/blob/7931ad32510ac162f9c4e1147bdd411e40cffa0e/examples/eddystone.rs

This beacon was then discoverable in nRF Connect on Android:

Screenshot of nRF Scanner with beacon