0

I'm realy stuck with this problem, what i try to do is to calculate distance between two devices using this function:

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;
        }
    }

but i can't figure out how to get the TxPower value of the device, please help;

naima
  • 129
  • 1
  • 12
  • 1
    Does this answer your question? [How to improve Bluetooth distance measuring using RSSI?](https://stackoverflow.com/questions/27939719/how-to-improve-bluetooth-distance-measuring-using-rssi) – Morrison Chang Apr 27 '20 at 00:33
  • 1
    Or: [What exactly is txPower for Bluetooth LE and how is it used?](https://stackoverflow.com/q/36862185/295004) – Morrison Chang Apr 27 '20 at 00:38

0 Answers0