Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
raysonyeung
Posts: 21
Registered: ‎02-07-2013
My Device: Z10

ifconfig result

Hi,

 

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.

 

STL100-1
SQN100-3
STL100-2
STL100-3
SQR100-2
STL100-4
SQN100-1
SQN100-5
SQN100-2
SQR100-3
PRO100-2
SQR100-1
STA100-3
STA100-1
STA100-2
STA100-5
Please use plain text.
Developer
dkonigs
Posts: 253
Registered: ‎07-25-2008
My Device: Bold 9900

Re: ifconfig result

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.)

Please use plain text.
Contributor
raysonyeung
Posts: 21
Registered: ‎02-07-2013
My Device: Z10

Re: ifconfig result

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.

Please use plain text.
BlackBerry Development Advisor
IsaacGordezky
Posts: 57
Registered: ‎10-04-2012
My Device: developer

Re: ifconfig result

Please use plain text.
Contributor
raysonyeung
Posts: 21
Registered: ‎02-07-2013
My Device: Z10

Re: ifconfig result


IsaacGordezky wrote:

The native netstatus api has more detailed information available:

http://developer.blackberry.com/native/reference/bb10/com.qnx.doc.bps.lib_ref/com.qnx.doc.bps.lib_re...


But it doesn't provide the data traffic information, right?

Please use plain text.