Why WifiConfiguration.BSSID is always null?
Asked Answered
S

0

13

I'm reading existing Wi Fi configuration. Code is pretty decent

    WifiManager wifiMgr = (WifiManager) getSystemService(Context.WIFI_SERVICE);
    List<WifiConfiguration> configurations= null;
    if (wifiMgr != null)
    {
        configurations = wifiMgr.getConfiguredNetworks();
    }

I have necessary permissions:

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission>

The problem is- all (at least in my case) BSSIDs in the WifiConfiguration is NULL, despite the fact that BSSID (MAC) can be seen in the Settings. What could be the problem and how to fix it?

Alternative question- where to get code for Setting's Wifi Settings (Gingerbread), as it does show BSSIDs

Sciolism answered 14/1, 2012 at 15:10 Comment(4)
possible duplicate of How to get BSSID of all wifi access points?Brisance
@DanteisnotaGeek I don’t think so. The question to which you are referring has a very specific purpose and is eventually solved through a workaround, whereas this question deals with a generic issue of the BSSID not being reported. I’m having the same issue: in wifi_supplicant.conf some of the configured wifis have a BSSID while others do not, but WifiManager.getConfiguredNetworks() returns no BSSIDs at all.Demoss
@Demoss did you figure it out? i am having the same issue. null bssidsDiapedesis
BSSID isn't even stored in wpa_supplicant.conf ; Additionally, android connects to any wifi with the same SSID and auth settings, paying zero regard to whether you've connected to that BSSID before or not. My android connects to every wifi network named "guest" even if I've never previously added that wifi network.Diapedesis

© 2022 - 2024 — McMap. All rights reserved.