本文介绍了获取Wi-Fi协议(的802.11a / b / g / n的)编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过WifiManager,我的Andr​​oid应用程序可以得到很多关于Wi-Fi的详细信息。不过,我没有得到这样的a / b / g / n的协议类型。我有一个客户要求这样做。

Through WifiManager, my Android app can get a lot of details about Wi-Fi. However I fail to get protocol type like a/b/g/n. I have a client requirement to do that.

有谁知道如何做到这一点? (我没有使用亚行选项)。但应编程完成。我坚信,设备和路由器已经协商的协议才可以连接。这样,信息就存在与设备。问题是,我们如何得到它?

Does anyone know how to achieve that? (I don't have the option to use adb). It is to be done programmatically. I strongly believe that device and router have already negotiated protocol before they can connect. So that information is there with device. Question is, how do we get it?

推荐答案

可以部分地从链路速度推断协议

You can partially deduce the protocol from the link speed

WifiManager.getConnectionInfo()。getLinkSpeed​​()

通过维基百科的802.11协议加速表中,可以判断它是802.11,802.11n标准或802.11股份公司。
的802.11n 和的全链路速度表

By Wikipedia 802.11 protocols speed table you can tell if it is 802.11b, 802.11n or 802.11ag.
802.11n and 802.11ac full link speed tables

的协议的802.11a和802.11g的连接速度是一样的,你可以在它们之间通过所使用的频率(5GHz的或2.4GHz的)的扫描结果区别开来。

Link speeds of protocols 802.11a and 802.11g are the same, you can distinguish between them by the used frequency (5GHz or 2.4GHz) in the scan results.

请注意该协议的连接,客户端和接入点的过程中可以改变做协商协议和速度,但他们同意的列表,而不是在一个特定的速度。

Note that protocol can change during the connection, client and access point do negotiate protocols and speeds but they agree on a list and not on one specific speed.

我不认为有一种方法的802.11n和802.11ac标准在其重叠的速度来区分。

I don't think there is a way to distinguish between 802.11n and 802.11ac in their overlapping speeds.

这篇关于获取Wi-Fi协议(的802.11a / b / g / n的)编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 20:01