@Override public LocalDevice newInstance(UDN udn, UDAVersion version, DeviceType type, DeviceDetails details, Icon[] icons, LocalService[] services, List<LocalDevice> embeddedDevices) throws ValidationException { return new LocalDevice( new DeviceIdentity(udn, getIdentity().getMaxAgeSeconds()), version, type, details, icons, services, embeddedDevices.size() > 0 ? embeddedDevices.toArray(new LocalDevice[embeddedDevices.size()]) : null ); }
public void localDeviceAdded(Registry registry, LocalDevice device) { System.out.println( "Local device added: " + device.getDisplayString() ); }
public void onLocalDeviceComplete(@Observes @Phase.Complete LocalDeviceDiscovery discovery) { LocalDevice device = discovery.getDevice(); String[] labels = new String[]{ device.getDetails().getFriendlyName(), device.getDisplayString(), "(LOCAL) " + device.getType().getDisplayString() }; final DeviceItem deviceItem = new DeviceItem(device, labels); Icon usableIcon = findUsableIcon(device); if (usableIcon != null) { ImageIcon imageIcon = new ImageIcon(usableIcon.getData()); deviceItem.setIcon(imageIcon); } else { deviceItem.setIcon(getUnknownDeviceIcon(deviceItem.getLabel()[0])); } SwingUtilities.invokeLater(new Runnable() { public void run() { view.addDeviceItem(deviceItem); } }); }
@Override public DeviceDetails getDetails(RemoteClientInfo info) { if (getDeviceDetailsProvider() != null) { return getDeviceDetailsProvider().provide(info); } return this.getDetails(); }
public OutgoingNotificationRequestDeviceType(Location location, LocalDevice device, NotificationSubtype type) { super(location, device, type); getHeaders().add(UpnpHeader.Type.NT, new DeviceTypeHeader(device.getType())); getHeaders().add(UpnpHeader.Type.USN, new DeviceUSNHeader(device.getIdentity().getUdn(), device.getType())); }
protected LocalDevice createDevice() throws ValidationException, LocalServiceBindingException { DeviceType type = new UDADeviceType("BinaryLight", 1); DeviceDetails details = new DeviceDetails( "Friendly Binary Light", new ManufacturerDetails("ACME"), new ModelDetails("AndroidLight", "A light with on/off switch.", "v1") ); LocalService service = new AnnotationLocalServiceBinder().read(SwitchPower.class); service.setManager( new DefaultServiceManager<>(service, SwitchPower.class) ); return new LocalDevice( new DeviceIdentity(udn), type, details, createDefaultDeviceIcon(), service ); } // DOC:CREATE_DEVICE
public OutgoingNotificationRequestUDN(Location location, LocalDevice device, NotificationSubtype type) { super(location, device, type); getHeaders().add(UpnpHeader.Type.NT, new UDNHeader(device.getIdentity().getUdn())); getHeaders().add(UpnpHeader.Type.USN, new UDNHeader(device.getIdentity().getUdn())); }
UDN udn = UpnpUtil.uniqueSystemIdentifier("msidmr"); device = new LocalDevice( Log.i(TAG, "getType: " + device.getType().toString()); } catch (ValidationException ex) { throw new RuntimeException(ex);
@Override public LocalDevice findDevice(UDN udn) { return find(udn, this); }
public static LocalDevice createDefaultDevice(UDN udn, String friendlyName, LocalService service) throws ValidationException { return new LocalDevice( new DeviceIdentity(udn, 1800), new UDADeviceType("BinaryLight", 1), new DeviceDetails( friendlyName, new ManufacturerDetails("ACME"), new ModelDetails("BinaryLight", "A demo light with on/off switch.", "v1"), new DLNADoc[]{ new DLNADoc("DMS", DLNADoc.Version.V1_5), new DLNADoc("M-DMS", DLNADoc.Version.V1_5) }, new DLNACaps(new String[] { "av-upload", "image-upload", "audio-upload" }) ), new Icon[]{createDefaultDeviceIcon()}, service ); }
public OutgoingSearchResponseUDN(IncomingDatagramMessage request, Location location, LocalDevice device) { super(request, location, device); getHeaders().add(UpnpHeader.Type.ST, new UDNHeader(device.getIdentity().getUdn())); getHeaders().add(UpnpHeader.Type.USN, new UDNHeader(device.getIdentity().getUdn())); } }
public OutgoingSearchResponseDeviceType(IncomingDatagramMessage request, Location location, LocalDevice device) { super(request, location, device); getHeaders().add(UpnpHeader.Type.ST, new DeviceTypeHeader(device.getType())); getHeaders().add(UpnpHeader.Type.USN, new DeviceUSNHeader(device.getIdentity().getUdn(), device.getType())); }
@Override public DeviceDetails getDetails(RemoteClientInfo info) { if (getDeviceDetailsProvider() != null) { return getDeviceDetailsProvider().provide(info); } return this.getDetails(); }
@Override public LocalDevice findDevice(UDN udn) { return find(udn, this); }
device = new LocalDevice( new DeviceIdentity(UDN.uniqueSystemIdentifier("Cling MediaRenderer")), new UDADeviceType("MediaRenderer", 1),
@Override public LocalDevice newInstance(UDN udn, UDAVersion version, DeviceType type, DeviceDetails details, Icon[] icons, LocalService[] services, List<LocalDevice> embeddedDevices) throws ValidationException { return new LocalDevice( new DeviceIdentity(udn, getIdentity().getMaxAgeSeconds()), version, type, details, icons, services, embeddedDevices.size() > 0 ? embeddedDevices.toArray(new LocalDevice[embeddedDevices.size()]) : null ); }
protected boolean isAdvertisementDisabled(LocalDevice device) { DiscoveryOptions options = getUpnpService().getRegistry().getDiscoveryOptions(device.getIdentity().getUdn()); return options != null && !options.isAdvertised(); }
public void localDeviceRemoved(Registry registry, LocalDevice device) { System.out.println( "Local device removed: " + device.getDisplayString() ); }
public OutgoingNotificationRequestDeviceType(Location location, LocalDevice device, NotificationSubtype type) { super(location, device, type); getHeaders().add(UpnpHeader.Type.NT, new DeviceTypeHeader(device.getType())); getHeaders().add(UpnpHeader.Type.USN, new DeviceUSNHeader(device.getIdentity().getUdn(), device.getType())); }
@Override public DeviceDetails getDetails(RemoteClientInfo info) { if (getDeviceDetailsProvider() != null) { return getDeviceDetailsProvider().provide(info); } return this.getDetails(); }