Want more features on Pastebin? Sign Up, it's FREE!
Guest

Stop alarm when Wifi strength reaches a specified level

By: a guest on Jun 7th, 2012  |  syntax: None  |  size: 0.58 KB  |  views: 579  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. });
clone this paste RAW Paste Data