Feat: SSDP discovery for hyperion-remote (#602)

* Auto stash before merge of "log" and "hyperion-project/master"

* resolve merge tool mess
This commit is contained in:
brindosch
2019-08-17 09:44:57 +02:00
committed by GitHub
parent c4d0edd9c2
commit d3f45e7ae5
17 changed files with 104 additions and 87 deletions

View File

@@ -36,7 +36,7 @@ void SSDPDiscover::searchForService(const QString& st)
const QString SSDPDiscover::getFirstService(const searchType& type, const QString& st, const int& timeout_ms)
{
Info(_log, "Search for Service [%s]", QSTRING_CSTR(st));
Info(_log, "Search for Hyperion server");
_searchTarget = st;
// search
@@ -91,7 +91,7 @@ const QString SSDPDiscover::getFirstService(const searchType& type, const QStrin
//Info(_log, "Received msearch response from '%s:%d'. Search target: %s",QSTRING_CSTR(sender.toString()), senderPort, QSTRING_CSTR(headers.value("st")));
if(type == STY_WEBSERVER)
{
Info(_log, "Found service [%s] at: %s:%d", QSTRING_CSTR(st), QSTRING_CSTR(url.host()), url.port());
Info(_log, "Found service at: %s:%d", QSTRING_CSTR(url.host()), url.port());
return url.host()+":"+QString::number(url.port());
}
@@ -104,10 +104,23 @@ const QString SSDPDiscover::getFirstService(const searchType& type, const QStrin
}
else
{
Info(_log, "Found service [%s] at: %s:%s", QSTRING_CSTR(st), QSTRING_CSTR(url.host()), QSTRING_CSTR(fbsport));
Info(_log, "Found service at: %s:%s", QSTRING_CSTR(url.host()), QSTRING_CSTR(fbsport));
return url.host()+":"+fbsport;
}
}
else if(type == STY_JSONSERVER)
{
const QString jssport = headers.value("hyperion-jss-port");
if(jssport.isEmpty())
{
continue;
}
else
{
Info(_log, "Found service at: %s:%s", QSTRING_CSTR(url.host()), QSTRING_CSTR(jssport));
return url.host()+":"+jssport;
}
}
}
}
Info(_log,"Search timeout, service [%s] not found", QSTRING_CSTR(st) );