Android wifi获取已连接Wifi的频率

编程入门 行业动态 更新时间:2024-10-28 16:25:52
本文介绍了Android wifi获取已连接Wifi的频率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

好吧,我有ScanResults,从那里我可以有SSID,BSSID,所有wifi的频率.

Well i have ScanResults and from there i can have SSID , BSSID , Frequency of all the wifi's.

List<ScanResult> results = wifi.getScanResults();

我也有Connected wifi信息,所以从那里我也有已连接的SSID和已连接的wifi的BSSID.

Also i have the Connected wifi info so from there also i am having SSID of connected and BSSID of the connected wifi.

WifiManager wifi; WifiInfo info; wifi = (WifiManager) getContext().getSystemService(Context.WIFI_SERVICE); info = wifi.getConnectionInfo();

现在,我只想拥有连接的wifi的频率,但是当我检查SSID和BSSID时,它们对于2个网络而言可以是相同的.现在如何找到连接的Wifi的频率.

Now i only want to have the frequency of the connected wifi but when i check SSID and BSSID they can be same for 2 network. Now how can i find the frequency of the connected Wifi.

我也想从那个wifi获得相应的频道号.

Also from that wifi i want to have corresponding channel no.

我找到了一张桌子

频道编号下限频率(GHZ)中心频率(GHZ)上限频率(GHZ)

CHANNEL NUMBER LOWER Freq(GHZ) CENTER Freq(GHZ) UPPER Freq(GHZ)

1 2401 2412 2423

1 2401 2412 2423

2 2404 2417 2428

2 2404 2417 2428

3 2411 2422 2433

3 2411 2422 2433

4 2416 2427 2438

4 2416 2427 2438

5 2421 2432 2443

5 2421 2432 2443

6 2426 2437 2448

6 2426 2437 2448

7 2431 2442 2453

7 2431 2442 2453

8 2436 2447 2458

8 2436 2447 2458

9 2441 2452 2463

9 2441 2452 2463

10 2451 2457 2468

10 2451 2457 2468

11 2451 2462 2473

11 2451 2462 2473

12 2456 2467 2478

12 2456 2467 2478

13 2461 2472 2483

13 2461 2472 2483

14 2473 2484 2495

14 2473 2484 2495

想知道sdk是否总是提供该表的中心频率,还有其他频率,例如5Ghz等?

Want to know whether sdk always provides center freq of this table and also what abt other freq like 5Ghz etc?

推荐答案

WifiInfo的频率仅自Lollipop(API 21)开始可用. developer.android/reference/android/net/wifi/WifiInfo.html#getFrequency()

The frequency from WifiInfo is only available since Lollipop (API 21) developer.android/reference/android/net/wifi/WifiInfo.html#getFrequency()

android.wifi.WifiInfo public int getFrequency () Returns the current frequency in FREQUENCY_UNITS.

更多推荐

Android wifi获取已连接Wifi的频率

本文发布于:2023-11-23 14:30:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1621784.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:频率   Android   wifi   Wifi

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!