Using CoreBluetooth I am getting these values from CBCentralManagerDelegate's
didDiscover peripheral
delegate method:
kCBAdvDataTxPowerLevel: 12 (could be other number like 7, 0 or a small negative number)
This one is taken from advertisementData parameter. This key might be absent.
rssi: -68 (or -60, -100, etc)
this is taken from the "rssi" parameter (always present).
I am looking for a formula to calculate approximate distance based on these two numbers. Is that possible?
I know that ideally I need to know rssi0 (rssi at 1 meter), but I don't see how I can get that via CoreBluetooth API or other means (without actually measuring rssi at one meter distance which is not good for me). How could I approximate rssi0 value with "kCBAdvDataTxPowerLevel"?