Advertisement
Guest User

Stop alarm when Wifi strength reaches a specified level

a guest
Jun 7th, 2012
943
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. //Variables
  2. var network = "WLAN_B3"; //CHANGE IT.
  3.  
  4. //WifiScan
  5. device.network.on("wifiScan", function (signal)
  6. {
  7. var results = signal.scanResults;
  8. for(var i=0;i<results.size();i++){
  9.  
  10. var wifi = results.get(i);
  11.  
  12. if(wifi.SSID == network) {
  13.  
  14. device.notifications.createNotification(wifi.level).show();
  15.  
  16. if(wifi.level > -40) { //CHANGE THE LEVEL [-90 ,.., -30] dBm approximately.
  17. //Code for disable the alarm.
  18. }
  19.  
  20. }
  21. }
  22.  
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement