多久轮询一次wifi信号强度? [英] How often to poll wifi signal strength?

查看:55
本文介绍了多久轮询一次wifi信号强度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

理想情况下,我想近乎实时地监测无线网络的信号强度,比如每 100 毫秒一次,但如此高的频率可能有点过头了.

Ideally I would like to monitor the signal strength of a wireless network in near real-time, say every 100ms, but such a high frequency is probably overkill.

我正在使用 Managed Wifi 库来轮询 RSSI.我实例化一个 WlanClient client = new WlanClient(); 一次并重新使用该 client 每隔一秒左右测量信号强度(但我想做更多经常):

I'm using the Managed Wifi library to poll RSSI. I instantiate a WlanClient client = new WlanClient(); once and re-use that client to measure signal strengths every second or so (but I'd like to do it more often):

foreach (WlanClient.WlanInterface wlanInterface in _client.Interfaces)
{
    Wlan.WlanBssEntry[] wlanBssEntries = wlanInterface.GetNetworkBssList();
    foreach (Wlan.WlanBssEntry wlanBssEntry in wlanBssEntries)
    {
        int sigStr = wlanBssEntry.rssi; // signal strength in dBm
        // ...
    }
}

最快的实际轮询延迟是多少?这是测量信号强度的最佳方法吗?

What is the fastest practical polling delay and is this the best way to measure signal strength?

推荐答案

恐怕最小的轮询延迟会因您的驱动程序堆栈而异,但我怀疑也与周围的接入点数量有关.WiFi 是一种基于时隙的协议.

I'm afraid the smallest polling delay will vary, with your driver stack but I suspect also with the number of Access Points around. WiFi is a protocol based on time slots.

根据我的(有限)经验,1 秒间隔大约是正确的,您已经看到站点列表并不总是完整的(即在 1 次扫描时丢失站点,在下一次重新扫描).

From my (limited) experience a 1 sec interval is about right, you will already see that the list of stations isn't always complete (ie stations missing on 1 scan, back on the next).

这是测量信号强度的最佳方法吗?

is this the best way to measure signal strength?

视情况而定,但您预计它的变化速度有多快?走动时,信号在一秒钟内变化不大.

Depends, but how fast do you expect it to change? When walking around, the signal won't vary much over a second.

这篇关于多久轮询一次wifi信号强度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆