可以过滤WifiManager的扫描吗?
我正在尝试扫描几个无线信号的强度。为此,我使用 WifiManager,在循环中调用 startScan() 并且有一个广播接收器来获取结果。
我的问题是:
如何仅对某些网络进行扫描?在结果中我得到了所有可用的网络。我可以过滤扫描以仅搜索某些 bssid 吗?还是ssid?除了我的 AP 值之外,我不关心其他值。我需要以尽可能最高的频率进行此扫描。
另一件事是:当我再次调用 startScan 时(上次调用后 500 毫秒)它会停止扫描吗?因为我想最大限度地减少获得信号的频率,但结果有时似乎不完整?
是否可以修改WifiManager类的源代码来过滤扫描到某些id?
多谢!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,您无法设置过滤器,但您可以稍后自己过滤结果,这不会对性能造成太大影响(过滤条目数小于 100 的列表)。另外,根据我的经验,如果您在扫描已经运行时请求扫描,则不会启动新的扫描。因此,在上次扫描返回结果之前启动新扫描是没有意义的。您也无法修改 WifiManager,因为它是 Android 平台的一部分。
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.