Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.0

Bug #11343 fix preg_match for rssi value/signal strength
Submitted: 2007-06-18 00:15 UTC
From: kguest Assigned: cweiske
Status: Closed Package: Net_Wifi (version CVS)
PHP Version: 5.1.2 OS: Ubuntu Linux (Dapper)
Roadmaps: 1.0.0    
Subscription  


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 23 + 27 = ?

 
 [2007-06-18 00:15 UTC] kguest (Ken Guest)
Description: ------------ output from iwconfig on Ubuntu 6.06.1 lists the rssi value as "Signal level:-77 dBm". Using a colon rather than an equals sign so a tweak to the preg_match expression is required. output of iwconfig --version is as follows: kguest:~$ iwconfig --version iwconfig Wireless-Tools version 28 Compatible with Wireless Extension v11 to v19. Kernel Currently compiled with Wireless Extension v19. wlan0 Recommend Wireless Extension v16 or later, Currently compiled with Wireless Extension v19. Test script: --------------- <?php require_once("Net/Wifi.php"); $nw = new Net_Wifi(); $interfaces = $nw->getSupportedInterfaces(); foreach($interfaces as $interface){ $nwc = $nw->getCurrentConfig($interface);//new Net_Wifi_Config(); if ($nw->isConnected ($interface)){ echo $interface, ": connected\n"; } else { echo $interface, ": not connected\n"; } var_dump($nwc); } ?> Expected result: ---------------- kguest:~$ php nw.php wlan0: connected object(Net_Wifi_Config)#2 (10) { ["activated"]=> bool(true) ["associated"]=> bool(true) ["ap"]=> string(17) "00:12:17:DF:2C:AE" ["ssid"]=> string(17) "Project-Node-Zero" ["mode"]=> string(7) "managed" ["nick"]=> NULL ["rate"]=> string(2) "11" ["power"]=> NULL ["protocol"]=> NULL ["rssi"]=> string(3) "-66" } Actual result: -------------- kguest:~$ php nw.php wlan0: connected object(Net_Wifi_Config)#2 (10) { ["activated"]=> bool(true) ["associated"]=> bool(true) ["ap"]=> string(17) "00:12:17:AD:2C:CE" ["ssid"]=> string(17) "Project-Node-Zero" ["mode"]=> string(7) "managed" ["nick"]=> NULL ["rate"]=> string(2) "11" ["power"]=> NULL ["protocol"]=> NULL ["rssi"]=> NULL }

Comments

 [2007-06-18 06:31 UTC] cweiske (Christian Weiske)
Ken, could you please attach the raw iwconfig output to the bug? I need it to make a unit test.
 [2007-06-18 10:51 UTC] kguest (Ken Guest)
kguest@t22:~$ #raw iwconfig output kguest@t22:~$ iwconfig lo no wireless extensions. eth0 no wireless extensions. irda0 no wireless extensions. wlan0 802.11b linked ESSID:"Project-Node-Zero" Mode:Managed Frequency:2.437 GHz Access Point: 00:12:17:AD:2C:CE Bit Rate=11 Mb/s Sensitivity=80/85 Retry:on Fragment thr:off Power Management:off Link Quality:93/100 Signal level:-49 dBm Noise level:-249 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 kguest@t22:~$
 [2007-06-18 14:01 UTC] cweiske (Christian Weiske)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.