Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android BLE // Using custom service UUID

We are developping a custom bluetooth low energy peripheral and we need to define our custom service. Based on this link: https://www.bluetooth.org/en-us/specification/assigned-numbers/service-discovery

All short UUID (16 bits) are reserved pending future revisions of the BT services specs. And it seems that current version of Android (4.4) doesn't support the 128 bits UUID.

So basically i can't use a 16 bits UUID for defining my service, but i can't filter my services with Android for a 128 bits UUID. Anyone got an idea on the best way to implement it ? Thanks

like image 753
M to the K Avatar asked Mar 20 '26 09:03

M to the K


1 Answers

I'm still not sure if it's ok to use custom 16 bits UUIDS so we manage to do something else based on this SO question. startLeScan with 128 bit UUIDs doesn't work on native Android BLE implementation

We scan all the devices and search for our service in the byte[] scanRecord returned by the LeScanCallback.

like image 64
M to the K Avatar answered Mar 21 '26 21:03

M to the K



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!