[WLANCONF]
authorCameron Gutman <aicommander@gmail.com>
Mon, 9 Jan 2012 20:19:33 +0000 (20:19 +0000)
committerCameron Gutman <aicommander@gmail.com>
Mon, 9 Jan 2012 20:19:33 +0000 (20:19 +0000)
- Display fractional rates correctly (5.5 Mbps for example)

svn path=/branches/wlan-bringup/; revision=54890

base/applications/network/wlanconf/wlanconf.c

index df05652..545d664 100644 (file)
@@ -514,9 +514,16 @@ WlanScan(HANDLE hAdapter)
                     Rate = Rate & 0x7F;
 
                     /* SupportedRates are in units of .5 */
                     Rate = Rate & 0x7F;
 
                     /* SupportedRates are in units of .5 */
-                    Rate = Rate >> 1;
-
-                    _tprintf(_T("%u "), Rate);
+                    if (Rate & 0x01)
+                    {
+                        /* Bit 0 is set so we need to add 0.5 */
+                        _tprintf(_T("%u.5 "), (Rate >> 1));
+                    }
+                    else
+                    {
+                        /* Bit 0 is clear so just print the conversion */
+                        _tprintf(_T("%u "), (Rate >> 1));
+                    }
                 }
             }
             _tprintf(_T("\n"));
                 }
             }
             _tprintf(_T("\n"));