Skip to content

Instantly share code, notes, and snippets.

@brianleroux
Created January 27, 2011 07:10
Show Gist options
  • Save brianleroux/798187 to your computer and use it in GitHub Desktop.
Save brianleroux/798187 to your computer and use it in GitHub Desktop.
// monitor wifi signal strength
navigator.system.get("Network", function(connection) {
// helper that updates the dom
function updateStatus(conn) {
var msg = "Wireless "+conn.essid+" at "+(conn.signalStrength*100)+"%";
x$('#network-status').html(msg);
}
// only watch the wifi setting
if (connection.type===connection.TYPE_IEEE802_11)
navigator.system.watch("WifiConnection", updateStatus);
}, null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment