Search code examples
ibeacon-androidandroid-ibeacon

Why is power byte required in beaconparser?


I am transmitting a custom beacon format. To transmit, I set up beacon parser. In the layout, it says that the power byte is a required field. Why is it a required field? Can I transmit a packet without power byte?

Also how is power byte in packet different from the txPowerLevel we set in BeaconTransmitter? Thanks


Solution

  • Power is a required field because if the library encounters this beacon it needs to know how to get a reference value for distance estimates. The library has no way of disabling these distance estimates, so making it required was a design decision.

    That said, if you really don't want to have a power value in the custom beacon format, you can always specify any byte offset you want to be the power field E.g. p:0-0, and the library will gladly accept that. But since that field won't actually contain the reference RSSI measurement at 1 meter, then the distance estimates for any beacons parsed with this layout will be completely wrong. That's fine, though -- just don't use the distance estimates, and don't be surprised that they return crazy values.