android - 从 ScanResult 或 : Interpreting ScanResult's 'capabilities' String 构建 WifiConfiguration

标签 android android-wifi wifi

你们这些 Android 高手是否知道任何开源代码来创建 WifiConfiguration来自给定的 ScanResult ?这会很有帮助。事实上,我捕获的(2012 年 4 月中旬)Android 源代码的第 483 (/624) 行 WifiConfiguration.java 是一个被注释掉的构造函数,旨在执行此操作,有一个很大的 TODO 想知道它是否是值得实现(见下面的引用)。我示意是,我可以听一下吗?

我看到的主要挑战(实际上是这个问题的首当其冲)是如何解释 ScanResult.configuration 字符串。

  1. 我可以期待一个简单的列表,例如 [WPA2-PSK-CCMP][WPS] 等吗?
  2. 这些字符串是否在文档或代码库中的某处枚举?
  3. 是否有设备/制造商/AP 特定的字符串我 应该知道什么?

来自 WifiConfiguration.java(可能进行编辑):

/** 
 * Construct a WifiConfiguration from a scanned network
 * @param scannedAP the scan result used to construct the config entry
 * TODO: figure out whether this is a useful way to construct a new entry.
 *   
public WifiConfiguration(ScanResult scannedAP) {
    networkId = -1; 
    SSID = scannedAP.SSID;
    BSSID = scannedAP.BSSID;
    // aaaah screw it I'm tired/lazy
}   
*/

https://code.google.com/p/android/issues/detail?id=60523

最佳答案

关于android - 从 ScanResult 或 : Interpreting ScanResult's 'capabilities' String 构建 WifiConfiguration,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10762533/

相关文章:

android - MobileAds.initialize(this) 崩溃致命信号 11 (SIGSEGV),代码 1 (SEGV_MAPERR)

android - 如何在android中通过代码隐藏标题栏

android - Kotlin - 从对象调用类方法

android - 包括 Google Play 下载器库 | APK文件扩展库

java - 自 Android Nougat 以来不再能够连接到 Wi-Fi 网络

android - 如何使用 Wi-Fi 将设备与 Android Studio Bumblebee 配对?

java - Android获取保存的网络SSID

windows - 检测尚未与无线网络建立任何连接的无线计算机

android - 无法收听 android wi-fi 管理器的状态?

android - 确保 http 连接通过 wifi