Thursday, May 20, 2010

[android-developers] Issue with WifiManager.calculateSignalLevel(RSSI, 5)

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:

http://developer.android.com/intl/de/reference/android/net/wifi/WifiManager.html#calculateSignalLevel%28int,%20int%29

But it appears to always return the same int no matter what the RSSI
level is.

Here is my code:

---

public int calculateQoS(int aRSSI){

signalLevel = WifiManager.calculateSignalLevel(RSSI, 5);

return signalLevel;

}


---


public void testCalculateQoS(){

Log.d("signal", "signal = : "
+ connMonitor.calculateQoS(-44)
+ " " + connMonitor.calculateQoS(-80)
+ " " + connMonitor.calculateQoS(-120)
+ " " + connMonitor.calculateQoS(-20));

}

The logging outputs 1 for all the test cases for calculateQoS(int).

Am I missing something simple here? Why is the SignalLevel always 1?

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate