Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Electric Imp imp API example code for imp.scanwifinetworks()
// Scan for local WLANs using imp.scanwifinetworks() asynchronously
try {
imp.scanwifinetworks(function(networks) {
if (networks.len() > 0) {
foreach (index, network in networks) {
server.log(format("%d. %s on channel %d", (index + 1), (network.ssid.len() > 0 ? network.ssid : "<Hidden>"), network.channel));
}
} else {
server.log("No nearby WiFi networks found");
}
});
} catch (err) {
server.error("Could not scan for networks (Error: " + err + ")");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment