Skip to content

Instantly share code, notes, and snippets.

@murilopontes
Last active July 10, 2017 11:03
Show Gist options
  • Save murilopontes/8363286 to your computer and use it in GitHub Desktop.
Save murilopontes/8363286 to your computer and use it in GitHub Desktop.
programmatically connect to WiFi access points
// from https://github.com/DigiExam/simplewifi
using SimpleWifi;
// Wifi object
Wifi wifi = new Wifi();
// get list of access points
IEnumerable<AccessPoint> accessPoints = wifi.GetAccessPoints();
// for each access point from list
foreach (AccessPoint ap in accessPoints){
//check if SSID is desired
if (ap.Name.StartsWith("ardrone_")){
//verify connection to desired SSID
if (!ap.IsConnected){
//connect if not connected
AuthRequest authRequest = new AuthRequest(ap);
ap.Connect(authRequest);
}
}
}
@vishnusuresan
Copy link

It doesnt work for wifi without password, how can we pass the password?

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