On Thu, 2010-03-18 at 03:40 -0700, Nguyen Canh Toan wrote: > Dear all, > > > > I am wondering how to get current connection speed. Or, alternatively, > how to get total bytes received and transmited (so current speed ~ > RX[n]-RX[n-1]).
Using bytes received and transmitted won't really get you a connection speed, since devices are usually not transmitting at full capacity all the time. It'll give you a "current DL/UL rate", but certainly not the actual connection speed of the device. Current connection speed is tricky, and depends on the specific device and the technology that the device is using. For Ethernet, you have the 'Speed' property in the D-Bus interface, which reports the current network device speed (10Mb, 100Mb, 1000Mb, etc) in Mb/s. For Wifi, there's the 'Bitrate' property in the D-Bus interface, which while the device is associated to an access point, reports the device's current rate in Kb/s (since wifi devices can transmit in odd rates, we can't just use Mb/s). For 3G, you can only get the general access technology that the device is using, not a raw bitrate. ModemManager reports current access technology for devices that support it via the AccessTechnology property of the device for GSM devices, which we'll also probably use for CDMA when that support gets folded in. For Bluetooth, it'll be the same as either Ethernet or 3G depending on how you're using the bluetooth device. Dan _______________________________________________ NetworkManager-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/networkmanager-list
