locked
How to connect to a Wifi network by its BSSID? RRS feed

All replies

  • User371688 posted

    @senglory Could you try to filter the bssid in the same way?

     string bssid = "abc";
     wifiManager.ConfiguredNetworks.FirstOrDefault(x => x.Bssid == bssid);
    
    Friday, August 24, 2018 9:30 AM
  • User371227 posted

    Already tried. The problem is that all items in .ConfiguredNetworks have Bssid= null. Always.

    Friday, August 24, 2018 5:04 PM
  • User366930 posted

    Did you manage to solve it? I'm struggling with same issue..

    Monday, July 8, 2019 11:54 AM
  • User371227 posted

    Here's my solution for WPA/WPA2

    string bssid = dto.BssID; string ssid = dto.Name; string password = dto.Password; var formattedSsid = $"\"{ssid}\""; var formattedPassword = $"\"{password}\""; const int WIFI_CONFIG_PRIORITY = 10000; var wifiConfig = new WifiConfiguration { Bssid = bssid, Ssid = formattedSsid, Priority = WIFI_CONFIG_PRIORITY }; var wifiManager = (WifiManager)Android.App.Application.Context.GetSystemService(Android.Content.Context.WifiService); var connManager = (ConnectivityManager)Android.App.Application.Context.GetSystemService(Android.Content.Context.ConnectivityService); wifiManager.SetWifiEnabled(true); var addNetworkIdx = wifiManager.AddNetwork(wifiConfig); var bd = wifiManager.Disconnect(); var enableNetwork = wifiManager.EnableNetwork(addNetworkIdx, true); var brc = wifiManager.Reconnect();

    Monday, July 8, 2019 3:23 PM