public static IBeaconDistanceDescriptor getDistanceDescriptor(final double accuracy) {
        if (accuracy < DISTANCE_THRESHOLD_WTF) {
            return IBeaconDistanceDescriptor.UNKNOWN;
        }

        if (accuracy < DISTANCE_THRESHOLD_IMMEDIATE) {
            return IBeaconDistanceDescriptor.IMMEDIATE;
        }

        if (accuracy < DISTANCE_THRESHOLD_NEAR) {
            return IBeaconDistanceDescriptor.NEAR;
        }

        return IBeaconDistanceDescriptor.FAR;
    }
Calculates the accuracy of an RSSI reading.
<p/>
The code was taken from <a href="http://stackoverflow.com/questions/20416218/understanding-ibeacon-distancing" /a>

@param txPower the calibrated TX power of an iBeacon
@param rssi    the RSSI value of the iBeacon
@return the calculated Accuracy
library/src/main/java/dev/alt236/bluetoothlelib/device/beacon/ibeacon/IBeaconUtils.java