Skip to content

Not detecting WiFi networks in just 1 computer #79

Description

@EasyLOB

Hi

I am using your NuGet package to list and get WiFi networks MAC Addresses and Signal.
Everything works fine, but in just 1 computer I do not get the WiF networks list.
I am able to see the networks in Windows desktop.
What, in your opinion, could be preventing detecting the WiFi networks ?
I even tried to call the Refresh method twice :-(

Thanks

List<WiFiNetwork> networks = new List<WiFiNetwork>();

await MyHelper.RefreshWiFiNetworksAsync();
networks = MyHelper.GetWiFiNetworks();

if (networks.Count == 0)
{
    await Task.Delay(2000);

    await MyHelper.RefreshWiFiNetworksAsync();
    networks = MyHelper.GetWiFiNetworks();
}

//

using ManagedNativeWifi;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

public static class MyHelper
{
    public static List<WiFiNetwork> GetWiFiNetworks()
    {
        return NativeWifi.EnumerateBssNetworks()
            .Select(x => new WiFiNetwork
            {
                //SSID = x.Ssid.ToString(),
                MACAddress = x.Bssid.ToString(),
                RSSI = x.Rssi
            })
            .OrderByDescending(x => x.RSSI)
            .ToList();
    }

    public static Task RefreshWiFiNetworksAsync()
    {
        return NativeWifi.ScanNetworksAsync(timeout: TimeSpan.FromSeconds(10));
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions