Issue with WifiManager.calculateSignalLevel(RSSI, 5)

后端 未结 3 1292
后悔当初
后悔当初 2020-12-30 18:47

I am trying to use the Wifimanager to calculate the Signal Level of the access points found during a scan.

I am using the following method:

WifiManager.calcu

3条回答
  •  再見小時候
    2020-12-30 19:13

    It seems that calculateSignalLevel is implemented this way:

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

    Maybe this code snippet can explain your problem. Also note:

    http://code.google.com/p/android/issues/detail?id=2555

提交回复
热议问题