fix upnp support to handle embededd devices (#4712)

Signed-off-by: Laurent ARNAL <laurent@clae.net>
pull/4715/head
lo92fr 2025-04-10 09:29:00 +02:00 committed by GitHub
parent 013de041ca
commit 601477d4cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View File

@ -149,6 +149,10 @@ public class UpnpDiscoveryService extends AbstractDiscoveryService
protected void startScan() {
for (RemoteDevice device : upnpService.getRegistry().getRemoteDevices()) {
remoteDeviceAdded(upnpService.getRegistry(), device);
for (RemoteDevice childDevice : device.getEmbeddedDevices()) {
remoteDeviceAdded(upnpService.getRegistry(), childDevice);
}
}
upnpService.getRegistry().addListener(this);
upnpService.getControlPoint().search();

View File

@ -216,7 +216,7 @@ public class UpnpIOServiceImpl implements UpnpIOService, RegistryListener {
}
private Device getDevice(UpnpIOParticipant participant) {
return upnpService.getRegistry().getDevice(new UDN(participant.getUDN()), true);
return upnpService.getRegistry().getDevice(new UDN(participant.getUDN()), false);
}
@Override
@ -354,7 +354,7 @@ public class UpnpIOServiceImpl implements UpnpIOService, RegistryListener {
@Override
public boolean isRegistered(UpnpIOParticipant participant) {
return upnpService.getRegistry().getDevice(new UDN(participant.getUDN()), true) != null;
return upnpService.getRegistry().getDevice(new UDN(participant.getUDN()), false) != null;
}
@Override
@ -508,6 +508,10 @@ public class UpnpIOServiceImpl implements UpnpIOService, RegistryListener {
@Override
public void remoteDeviceAdded(Registry registry, RemoteDevice device) {
informParticipants(device, true);
for (RemoteDevice childDevice : device.getEmbeddedDevices()) {
informParticipants(childDevice, true);
}
}
@Override
@ -517,6 +521,10 @@ public class UpnpIOServiceImpl implements UpnpIOService, RegistryListener {
@Override
public void remoteDeviceRemoved(Registry registry, RemoteDevice device) {
informParticipants(device, false);
for (RemoteDevice childDevice : device.getEmbeddedDevices()) {
informParticipants(childDevice, false);
}
}
@Override