Wifi Signal Strength Percentage to RSSI dBm

Wifi Signal Strength Percentage to RSSI dBm

Microsoft defines Wifi signal quality in their WLAN_ASSOCIATION_ATTRIBUTES structure as follows:

wlanSignalQuality:

A percentage value that represents the signal quality of the network. WLAN_SIGNAL_QUALITY is of type ULONG. This member contains a value between 0 and 100. A value of 0 implies an actual RSSI signal strength of -100 dbm. A value of 100 implies an actual RSSI signal strength of -50 dbm. You can calculate the RSSI signal strength value for wlanSignalQuality values between 1 and 99 using linear interpolation.

RSSI (or "Radio (Received) Signal Strength Indicator") are in units of 'dB' (decibel) or the similar 'dBm' (dB per milliwatt) (See dB vs. dBm) in which the smaller magnitude negative numbers have the highest signal strength, or quality.


Therefore, the conversion between quality (percentage) and dBm is as follows:

    quality = 2 * (dBm + 100)  where dBm: [-100 to -50]

    dBm = (quality / 2) - 100  where quality: [0 to 100]

Pseudo Code (with example clamping):

    // dBm to Quality:
    if(dBm <= -100)
        quality = 0;
    else if(dBm >= -50)
        quality = 100;
    else
        quality = 2 * (dBm + 100);

    // Quality to dBm:
    if(quality <= 0)
        dBm = -100;
    else if(quality >= 100)
        dBm = -50;
    else
        dBm = (quality / 2) - 100;

Note:

Check the definition of Quality that you are using for your calculations carefully. Also check the range of dB (or dBm). The limits may vary.

Examples:

Medium quality:   50%      ->   -75dBm   = (50 / 2) - 100
Low quality:      -96dBm   ->   8%       = 2 * (-96 + 100)

http://stackoverflow.com/questions/15797920/how-to-convert-wifi-signal-strength-from-quality-percent-to-rssi-dbm

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值