Attempt to obtain distance using rssi, but rssi receives normally, but only 127 attempts to obtain txPower using the getxPower() method in scanresult.class. What should I do to receive the txpower value of ibeacon normally?
txpower of getxPowerlevel() is received normally and can txpower be replaced by txpowerlevel in the formula below?
When the txpower level is 0dbm, the equation below is not calculated, so I'm not sure if it's correct.
protected static double calculateAccuracy(int txPower, double rssi) {
if (rssi == 0) {
return -1.0; // if we cannot determine accuracy, return -1.
}
double ratio = rssi*1.0/txPower;
if (ratio < 1.0) {
return Math.pow(ratio,10);
}
else {
double accuracy = (0.89976)*Math.pow(ratio,7.7095) + 0.111;
return accuracy;
}
}
When you set iBeacon, don't you think txpower is properly set, so 0xff is listed in the txpower field in broadcast?
© 2024 OneMinuteCode. All rights reserved.