Created
January 27, 2011 07:10
-
-
Save brianleroux/798187 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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