什么RSSI的机器人WifiManager的意义 [英] What's the meaning of Rssi in android WifiManager

查看:191
本文介绍了什么RSSI的机器人WifiManager的意义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让使用当前的WiFi连接 getRssi()

I am trying to get the signal strength of the current wifi connection using getRssi()

private void checkWifi(){
    ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo Info = cm.getActiveNetworkInfo();
    if (Info == null || !Info.isConnectedOrConnecting()) {
        Log.i("WIFI CONNECTION", "No connection");
    } else {
        int netType = Info.getType();
        int netSubtype = Info.getSubtype();

        if (netType == ConnectivityManager.TYPE_WIFI) {
            wifiManager = (WifiManager)getApplicationContext().getSystemService(Context.WIFI_SERVICE);
            int linkSpeed = wifiManager.getConnectionInfo().getLinkSpeed();
            int rssi = wifiManager.getConnectionInfo().getRssi();
            Log.i("WIFI CONNECTION", "Wifi connection speed: "+linkSpeed + " rssi: "+rssi);


        //Need to get wifi strength
        } 
    }
}

的事情是我得到的数字,例如-35或-47等..和我不明白他们的价值观。我已经看过了Android文档和所有它规定:

thing is i get numbers like -35 or -47 ect.. and i don't understand their values.. I have looked at the android documentation and all it states:

公众诠释getRssi()

public int getRssi ()

自:API级别1返回的接收信号强度指示器   当前的802.11网络

Since: API Level 1 Returns the received signal strength indicator of the current 802.11 network.

这是不是归一化,而应该是!

This is not normalized, but should be!

返回的RSSI,在范围???到???

Returns the RSSI, in the range ??? to ???

有人可以解释如何正常化,或理解这些结果?

can someone explain how to 'normalize' or understand these results?

推荐答案

根据IEEE 802.11的文档:小负值表示更高的信号强度

According to IEEE 802.11 documentation: Lesser negative values denotes higher signal strength.

的范围为-100至0 dBm时,越接近0的更高的强度,反之亦然。

这篇关于什么RSSI的机器人WifiManager的意义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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