Filter the scan of WifiManager possible?

1.1k Views Asked by At

I am trying to scan the strength of several wireless signals. For that I use the WifiManager, in a loop I call startScan() and I have a broadcast receiver to get the results.

My question is:

How can I make a scan ONLY for some networks? In the results I get all the networks available. Can I filter the scan to search only for some bssids? or ssid? I don´t care about other values than the ones of my AP´s. And I need to do this scan with the highest frecuency possible.

Another thing is: when I call startScan again (500ms after the previous call) does it stop the scanning? Because I want to reduce to maximun the frequency of getting the signals streght and it seems that the results sometimes are incomplete??

Would it be possible to modify the source code of WifiManager class to filter the scan to some ids?

Thanks a lot!

1

There are 1 best solutions below

1
On

No, you can't set a filter, but you can filter the results later on yourself, which should have not a big performance hit (filtering a list with < 100 entries). Also, from my experience, if you request a scan while a scan is already running, no new scan is initiated. Therefore there is no point in starting a new scan before the last scan has returned results. You also can't modify the WifiManager as it is part of the android platform.