PDA

View Full Version : Qt Access Point Name



jedendaya
10th March 2016, 08:25
Hi,

Im using Qt 5.5 in Windows, i have a program that shows the ff:

IP ADDRESS - "10.24.119.22"
WIFI CONNECTION - "10.24.200.39"

using this QT codes


QList<QHostAddress> list = QNetworkInterface::allAddresses();
QHostInfo info;
QString qstr = info.localDomainName();
qDebug() << qstr;
for(int nIter=0; nIter<list.count(); nIter++)

{
if(!list[nIter].isLoopback())
if (list[nIter].protocol() == QAbstractSocket::IPv4Protocol )
qDebug() << list[nIter].toString();


}

is there a way that instead of showing the "address" the project will show the "Access Point Name" of the WLAN?

can somebody help me with this.

Thank you

jefftee
11th March 2016, 02:22
QNetworkInterface::humanReadableName() will return the name of the interface that is configured in the control panel, but I don't know how you can actually get the SSID name.

Is the SSID shown when you do a ipconfig command from the command line? (I don't use windows) If it is shown, you could run ipconfig in a QProcess and read the output and find the SSID name, etc. If it's not shown, I don't know you you could determine the SSID, it's certainly not part of QNetworkInterface's functionality.

anda_skoa
11th March 2016, 09:48
There might also be some operating system API to get that information.

Cheers,
_