mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
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:
@@ -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) );
|
||||
|
Reference in New Issue
Block a user