问题
I am trying to find a way to access the battery levels from my beacons through an iOS application I am currently working on. I am using Kontakt's iBeacon devices. I browsed the Estimote iOS SDK and they provide a method to achieve this. I was wondering if it is at all able to access the raw beacon packet and manually extract the data since I know the beacon packet structure and the information is there.
Any thoughts on how to achieve this by the method mentioned here or any other way?
Thanks Guys.
回答1:
This is Rafal from kontakt.io. Firstly, let me thank you for choosing us, it means a lot for us.
Propagation of battery level is not standard for iBeacons nor it is in any official iBeacon documentation, so that is why you cannot find the value using custom SDKs. Our iBeacons are propagating battery level in scan response packet which may be discovered using CoreBluetooth API in iOS. The level is one byte value at the 23rd byte in the packet.
Hope it helps :)
回答2:
As far as I am aware there is nothing in the iBeacon advertisement itself that contains the battery level. Some beacons may expose additional BLE ATT services that contain this information. You could try using an application like LightBlue from the app store to explore the services available from your devices
来源:https://stackoverflow.com/questions/23207687/accessing-battery-level-of-battery-powered-ibeacon-devices-mainly-kontakt-io-on