Created
April 16, 2018 12:57
-
-
Save LuisFcoOrtiz/84837d2b6bf6e0f266b741621aff1bc7 to your computer and use it in GitHub Desktop.
Get Mac Address QT Cpp (function) | Obtener dirección MAC QT cpp (función))
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//#include <QNetworkInterface> en cabecera | |
QString ClientUdp::getMacAddress() { | |
foreach(QNetworkInterface netInterface, QNetworkInterface::allInterfaces()) { | |
// Devuelve solo la primera dirección MAC que no sea de loopback | |
if (!(netInterface.flags() & QNetworkInterface::IsLoopBack)) | |
return netInterface.hardwareAddress(); | |
qDebug() << "obteniendo dirección MAC"; | |
} | |
return QString(); | |
}//funcion para obtener la direccion MAC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment