Skip to content Skip to sidebar Skip to footer

How To Get Battery Level Of Kontakt Ibeacons

The ibeacon beaconlayout for kontakt is m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25 I am using altbeacon library for android for detecting it but i am unable get the battery

Solution 1:

If your beaconlayout expression is correct for that beacon, then you can read the battery value for the d25-25 data field with:

long batteryLevel=beacon.getDataFields().get(0);

See documentation for reading data fields here:

http://altbeacon.github.io/android-beacon-library/javadoc/org/altbeacon/beacon/Beacon.html#getDataFields()

However, the first link in your question mentions the field is in the "scan response" of the beacon. If that statement is true and not a misstatement, that means the battery level is not in the advertisement at all, so you will not be able to get it without separately polling for this info.

Post a Comment for "How To Get Battery Level Of Kontakt Ibeacons"