mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-14 18:57:07 -07:00
Add Discovery and Wakeup for PS5
This commit is contained in:
parent
65add80ec6
commit
8904c86a6d
9 changed files with 42 additions and 19 deletions
|
@ -44,7 +44,7 @@ class DiscoveryManager : public QObject
|
|||
|
||||
void SetActive(bool active);
|
||||
|
||||
void SendWakeup(const QString &host, const QByteArray ®ist_key);
|
||||
void SendWakeup(const QString &host, const QByteArray ®ist_key, bool ps5);
|
||||
|
||||
const QList<DiscoveryHost> GetHosts() const { return hosts; }
|
||||
|
||||
|
|
|
@ -58,7 +58,6 @@ void DiscoveryManager::SetActive(bool active)
|
|||
|
||||
sockaddr_in addr = {};
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons(CHIAKI_DISCOVERY_PORT);
|
||||
addr.sin_addr.s_addr = 0xffffffff; // 255.255.255.255
|
||||
options.send_addr = reinterpret_cast<sockaddr *>(&addr);
|
||||
options.send_addr_size = sizeof(addr);
|
||||
|
@ -80,7 +79,7 @@ void DiscoveryManager::SetActive(bool active)
|
|||
|
||||
}
|
||||
|
||||
void DiscoveryManager::SendWakeup(const QString &host, const QByteArray ®ist_key)
|
||||
void DiscoveryManager::SendWakeup(const QString &host, const QByteArray ®ist_key, bool ps5)
|
||||
{
|
||||
QByteArray key = regist_key;
|
||||
for(size_t i=0; i<key.size(); i++)
|
||||
|
@ -100,7 +99,7 @@ void DiscoveryManager::SendWakeup(const QString &host, const QByteArray ®ist_
|
|||
throw Exception("Invalid regist key");
|
||||
}
|
||||
|
||||
ChiakiErrorCode err = chiaki_discovery_wakeup(&log, service_active ? &service.discovery : nullptr, host.toUtf8().constData(), credential);
|
||||
ChiakiErrorCode err = chiaki_discovery_wakeup(&log, service_active ? &service.discovery : nullptr, host.toUtf8().constData(), credential, ps5);
|
||||
|
||||
if(err != CHIAKI_ERR_SUCCESS)
|
||||
throw Exception(QString("Failed to send Packet: %1").arg(chiaki_error_string(err)));
|
||||
|
|
|
@ -212,7 +212,8 @@ void MainWindow::SendWakeup(const DisplayServer *server)
|
|||
|
||||
try
|
||||
{
|
||||
discovery_manager.SendWakeup(server->GetHostAddr(), server->registered_host.GetRPRegistKey());
|
||||
discovery_manager.SendWakeup(server->GetHostAddr(), server->registered_host.GetRPRegistKey(),
|
||||
chiaki_target_is_ps5(server->registered_host.GetTarget()));
|
||||
}
|
||||
catch(const Exception &e)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue