I have spent ages on this and I am stuck.
I am trying to connect to a known hidden SSID programmatically.
I am using the following code
await firstAdapter.ScanAsync();
WiFiAvailableNetwork network = firstAdapter.NetworkReport.AvailableNetworks.FirstOrDefault(n => n.Ssid == ssid);
The problem is I need to supply as a first an object of type WiFiAvailableNetwork
but AvailableNetworks
only brings back non-hidden SSIDs.
public IAsyncOperation<WiFiConnectionResult> ConnectAsync(WiFiAvailableNetwork availableNetwork, WiFiReconnectionKind reconnectionKind, PasswordCredential passwordCredential, String ssid)
The above code works perfectly with non-hidden SSID's.
Is there an API to connect to a hidden SSID?
Thanks
If available, the hidden network should be in the firstAdapter.NetworkReport.AvailableNetworks
list.
As the SSID is hidden, the Ssid
property of WiFiAvailableNetwork
for the target network will be ""
.
You could make an assumption here and attempt to connect to it using:
await firstAdapter.ConnectAsync(networks.First(x => x.Ssid == ""), WiFiReconnectionKind.Automatic, "password", "knownSSID");