android-beacon-library: ibeacon: how to access service data?

305 Views Asked by At

Each iBeacon advertising message consists of multiple PDUs (blocks) having length, type and data: type 1 contains bluetooth flags as a bitfield, type 9 contains the local device name as a string, type 10 contains the txpower as signed integer and so on. The BeaconParser class just parses type 255 (0xff) which is the manufacturer data and contains major and minor number.

I need to get the data of PDU type 22 (0x16) which contains service data uuids and there values There are well-known service data uuids like 180f for battery service and many more List of UUIDs

Is there a way to access type 22 from android-beacon-libary? I know it is possible from the low level android-bluetooth-api onScanResult() with ScanResult parsed.refer here

1

There are 1 best solutions below

0
davidgyoung On

The library does not parse AD type 0x22 as it is not used by any commonly used beacon formats today. A change to the library source code would be needed to do so. If you are interested in working on a Pull Request to add this functionality and can describe in detail how you would like it to work, Please open an issue against the library’s GitHub repo with this info, and we can discuss.