Merge PR #305: Reenable UPnP, regardless if ZeroConf is enabled already

This commit is contained in:
Jenkins nymea 2020-01-18 01:31:38 +01:00
commit cb47b66c70
3 changed files with 9 additions and 19 deletions

View File

@ -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();

View File

@ -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) {

View File

@ -391,9 +391,9 @@ void NymeaConnection::updateActiveBearers()
{
NymeaConnection::BearerTypes availableBearerTypes;
QList<QNetworkConfiguration> configs = m_networkConfigManager->allConfigurations(QNetworkConfiguration::Active);
// qDebug() << "Network configuations:" << configs.count();
qDebug() << "Network configuations:" << configs.count();
foreach (const QNetworkConfiguration &config, configs) {
// qDebug() << "Active network config:" << config.name() << config.bearerTypeFamily() << config.bearerTypeName();
qDebug() << "Active network config:" << config.name() << config.bearerTypeFamily() << config.bearerTypeName();
// NOTE: iOS doesn't correctly report bearer types. It'll be Unknown all the time. Let's hardcode it to WiFi for that...
#if defined(Q_OS_IOS)