可以过滤WifiManager的扫描吗?

发布于 2024-11-04 17:44:59 字数 337 浏览 8 评论 0原文

我正在尝试扫描几个无线信号的强度。为此,我使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

回忆躺在深渊里 2024-11-11 17:44:59

不,您无法设置过滤器,但您可以稍后自己过滤结果,这不会对性能造成太大影响(过滤条目数小于 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文