SHARE
TWEET

Stop alarm when Wifi strength reaches a specified level

a guest Jun 7th, 2012 595 Never
  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. });
RAW Paste Data
Top