08-06-2013 01:16 AM
I am currently checking the network condition with the "ifconfig -v" command via QProcess.
However, I found that different device model return different value of the network interface.
For example the WiFI of the device STA100-1 is "bcm0", but it is "tiw_drv0" in STL100-1.
It is confused that different device provides different interface name.
I want to know all "tags" of different device models.
It is better to have documentation for it.
Otherwise I cannot support all devices.
Thank you very much.
Here is the model list that I have at this moment.
08-06-2013 01:53 AM
There is a much better way of doing this. Use QNetworkConfigurationManager to return a list of QNetworkConfiguration objects. These objects have a property called "bearerType", which can tell you what kind of interface it is. In practice, I've only seen this return two of the possible values: "BearerWLAN" for WiFi, and "Bearer2G" for the cellular network. However, this will tell you what you want to know.
(If you really need something like ifconfig output, there's also the QNetworkInterface class, but it may take some work to match it up with the results from QNetworkConfigurationManager.)
08-06-2013 04:09 AM
I already know both Classes, but they are not sufficient my need.
What I want is not just the WiFi/ Cellular network.
QNetworkConfigurationManager doesn't provide the ip addrees for those networks and it doesn't fully access all entries from ifconfig.
QNetworkInterface only provide all IP addresses that current device has, but not the information to match up to WiFi/Cellular.
From ifconfig, I can also get information about USB, BlueTooth, even other network interface information.
That's what I need.
08-06-2013 09:31 PM
The native netstatus api has more detailed information available:
But it doesn't provide the data traffic information, right?