PDA

View Full Version : Get the product/device name using QT library?



predatorz
13th January 2010, 16:51
Hi,

I am using QT4.6, trying to write an application that will run on windows and linux.
I am able to get the network interfaces and its associated MAC address in both windows and linux using QNetworkInterface functions.
Is there a way to get the product name for the network interface as well using QT?

e.g for linux, i can get wlan0,
is there a way to get its product/device name --> AR928X Wireless Network Adapter (PCI-Express) [168c:002a] or something similar?

wysota
13th January 2010, 17:05
Qt has no facilities to do that.

squidge
13th January 2010, 23:41
Under Linux, you can parse /proc if it's mounted. I don't know of other ways.

Under Windows you can use SetupDi* functions (GetClassDevs, EnumDeviceInterfaces, EnumDeviceInfo, etc).

I don't know of any portable way of doing it.

ChrisW67
14th January 2010, 03:53
I am able to get the network interfaces and its associated MAC address in both windows

You might want to check that the MAC returned on Windows Vista/7 when running as an unprivileged user is the real MAC, and not just a random return, if that is important to you. Some hardware locking schemes using the MAC fall foul of this when the "MAC" changes.