Merge PR #305: Reenable UPnP, regardless if ZeroConf is enabled already
This commit is contained in:
commit
cb47b66c70
@ -49,21 +49,13 @@ void NymeaDiscovery::setDiscovering(bool discovering)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
m_discovering = discovering;
|
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 (discovering) {
|
||||||
// If there's no Zeroconf, use UPnP instead
|
// ZeroConf is always in discovery mode, nothing to do...
|
||||||
if (!m_zeroConf->available()) {
|
|
||||||
m_upnp->discover();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Always start Bluetooth discovery if HW is available
|
// Start UPnP discovery
|
||||||
|
m_upnp->discover();
|
||||||
|
|
||||||
|
// Start Bluetooth discovery if HW is available
|
||||||
if (m_bluetooth) {
|
if (m_bluetooth) {
|
||||||
m_bluetooth->discover();
|
m_bluetooth->discover();
|
||||||
}
|
}
|
||||||
@ -75,9 +67,7 @@ void NymeaDiscovery::setDiscovering(bool discovering)
|
|||||||
m_awsClient->fetchDevices();
|
m_awsClient->fetchDevices();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!m_zeroConf->available()) {
|
m_upnp->stopDiscovery();
|
||||||
m_upnp->stopDiscovery();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_bluetooth) {
|
if (m_bluetooth) {
|
||||||
m_bluetooth->stopDiscovery();
|
m_bluetooth->stopDiscovery();
|
||||||
|
|||||||
@ -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);
|
NymeaHost* device = m_nymeaHosts->find(uuid);
|
||||||
if (!device) {
|
if (!device) {
|
||||||
|
|||||||
@ -391,9 +391,9 @@ void NymeaConnection::updateActiveBearers()
|
|||||||
{
|
{
|
||||||
NymeaConnection::BearerTypes availableBearerTypes;
|
NymeaConnection::BearerTypes availableBearerTypes;
|
||||||
QList<QNetworkConfiguration> configs = m_networkConfigManager->allConfigurations(QNetworkConfiguration::Active);
|
QList<QNetworkConfiguration> configs = m_networkConfigManager->allConfigurations(QNetworkConfiguration::Active);
|
||||||
// qDebug() << "Network configuations:" << configs.count();
|
qDebug() << "Network configuations:" << configs.count();
|
||||||
foreach (const QNetworkConfiguration &config, configs) {
|
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...
|
// 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)
|
#if defined(Q_OS_IOS)
|
||||||
|
|||||||
Reference in New Issue
Block a user