summaryrefslogtreecommitdiffstats
path: root/LogReceiver/networkdiscovery.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'LogReceiver/networkdiscovery.cpp')
-rw-r--r--LogReceiver/networkdiscovery.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/LogReceiver/networkdiscovery.cpp b/LogReceiver/networkdiscovery.cpp
index a526a6f..ee0b5ad 100644
--- a/LogReceiver/networkdiscovery.cpp
+++ b/LogReceiver/networkdiscovery.cpp
@@ -154,6 +154,11 @@ QList<QString> NetworkDiscovery::getListOfNetworkInterfaces() {
if(!(nI.flags() & QNetworkInterface::IsUp)) {
_networkManager.bringInterfaceUP(nI.humanReadableName());
}
+ /*
+ * if(!checkForIsRunning(nI)) {
+ continue;
+ }
+ */
if (!checkCarrierState(nI.humanReadableName())) {
continue;
}
@@ -166,6 +171,18 @@ QList<QString> NetworkDiscovery::getListOfNetworkInterfaces() {
return result;
}
+bool NetworkDiscovery::checkForIsRunning(QNetworkInterface networkInterface) {
+ bool retval = false;
+ for (int i = 0; i < 4; i++) {
+ retval = (networkInterface.flags() & QNetworkInterface::IsRunning);
+ if(retval) {
+ return retval;
+ }
+ sleep(1);
+ }
+ return retval;
+}
+
QList<QString> NetworkDiscovery::checkCarrierState(QList<QString> &interfaces) {
QList<QString> result;
foreach(QString nI, interfaces)