Net_Wifi
[ class tree: Net_Wifi ] [ index: Net_Wifi ] [ all elements ]

Source for file Wifi_usage.php

Documentation is available at Wifi_usage.php

  1. <?php
  2. /**
  3. *   How to use Net_Wifi
  4. *   @author Christian Weiske <cweiske@php.net>
  5. */
  6.  
  7. require_once 'Net/Wifi.php';
  8. $wifi = new Net_Wifi();
  9.  
  10. //get all wireless interfaces
  11. $interfaces $wifi->getSupportedInterfaces();
  12. if (count($interfaces== 0{
  13.     echo 'No wireless interfaces found!' "\r\n";
  14.     exit();
  15. }
  16. foreach ($interfaces as $interface{
  17.     echo 'Wireless interface: ' $interface "\r\n";
  18. }
  19.  
  20. echo "========================\r\n";
  21.  
  22.  
  23. //get the current configuration of the first interface
  24. echo "Current configuration of first interface:\n";
  25. var_dump($wifi->getCurrentConfig($interfaces[0]));
  26.  
  27. echo "========================\r\n";
  28.  
  29.  
  30. //scan for available networks
  31. echo "Available networks:\n";
  32. $networks $wifi->scan($interfaces[0]);
  33. if (count($networks== 0{
  34.     echo 'No wireless networks available.' "\r\n";
  35.     exit();
  36. }
  37.  
  38. var_dump($networks);
  39.  
  40. ?>

Documentation generated on Wed, 19 Jun 2013 08:30:02 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.