I found this code, but I donβt know how to get the values, maybe there is a class that needs to be imported: please check and let me know.
public static int calculateSignalLevel(int rssi, int numLevels) { if (rssi <= MIN_RSSI) {return 0;} else if (rssi >= MAX_RSSI) { return numLevels - 1; } else { int partitionSize = (MAX_RSSI - MIN_RSSI) / (numLevels - 1); return (rssi - MIN_RSSI) / partitionSize; } }
source share