From 8f0379945f0e6e87811ed2d6b7e9888bb5fc4391 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Fri, 17 Jan 2020 23:06:04 +0100 Subject: [PATCH] Reenable UPnP, regardless if ZeroConf is enabled already --- .../connection/discovery/nymeadiscovery.cpp | 22 +++++-------------- .../connection/discovery/upnpdiscovery.cpp | 2 +- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/libnymea-app-core/connection/discovery/nymeadiscovery.cpp b/libnymea-app-core/connection/discovery/nymeadiscovery.cpp index e4c8716b..696e8a9c 100644 --- a/libnymea-app-core/connection/discovery/nymeadiscovery.cpp +++ b/libnymea-app-core/connection/discovery/nymeadiscovery.cpp @@ -49,21 +49,13 @@ void NymeaDiscovery::setDiscovering(bool discovering) return; m_discovering = discovering; - // If we have zeroconf skip upnp. ZeroConf will not do an active discovery and if it's available it'll always have good data - if (!m_zeroConf->available()) { - if (discovering) { - m_upnp->discover(); - } else { - m_upnp->stopDiscovery(); - } - } if (discovering) { - // If there's no Zeroconf, use UPnP instead - if (!m_zeroConf->available()) { - m_upnp->discover(); - } + // ZeroConf is always in discovery mode, nothing to do... - // Always start Bluetooth discovery if HW is available + // Start UPnP discovery + m_upnp->discover(); + + // Start Bluetooth discovery if HW is available if (m_bluetooth) { m_bluetooth->discover(); } @@ -75,9 +67,7 @@ void NymeaDiscovery::setDiscovering(bool discovering) m_awsClient->fetchDevices(); } } else { - if (!m_zeroConf->available()) { - m_upnp->stopDiscovery(); - } + m_upnp->stopDiscovery(); if (m_bluetooth) { m_bluetooth->stopDiscovery(); diff --git a/libnymea-app-core/connection/discovery/upnpdiscovery.cpp b/libnymea-app-core/connection/discovery/upnpdiscovery.cpp index 03dffc62..6cab64b7 100644 --- a/libnymea-app-core/connection/discovery/upnpdiscovery.cpp +++ b/libnymea-app-core/connection/discovery/upnpdiscovery.cpp @@ -238,7 +238,7 @@ void UpnpDiscovery::networkReplyFinished(QNetworkReply *reply) } } -// qDebug() << "discovered device" << uuid << name << discoveredAddress << version << connections << data; + qDebug() << "UPnP: Discovered device" << name << discoveredAddress << version << connections /*<< data*/; NymeaHost* device = m_nymeaHosts->find(uuid); if (!device) {