use of org.jupnp.model.meta.RemoteDevice in project smarthome by eclipse.
the class UpnpDiscoveryService method startScan.
@Override
protected void startScan() {
for (RemoteDevice device : upnpService.getRegistry().getRemoteDevices()) {
remoteDeviceAdded(upnpService.getRegistry(), device);
}
upnpService.getRegistry().addListener(this);
upnpService.getControlPoint().search();
}
use of org.jupnp.model.meta.RemoteDevice in project smarthome by eclipse.
the class HueBridgeDiscoveryParticipantOSGITest method setUp.
@Before
public void setUp() {
discoveryParticipant = getService(UpnpDiscoveryParticipant.class, HueBridgeDiscoveryParticipant.class);
assertThat(discoveryParticipant, is(notNullValue()));
try {
final RemoteService remoteService = null;
hueDevice = new RemoteDevice(new RemoteDeviceIdentity(new UDN("123"), 60, new URL("http://hue"), null, null), new DeviceType("namespace", "type"), new DeviceDetails(new URL("http://1.2.3.4/"), "Hue Bridge", new ManufacturerDetails("Philips"), new ModelDetails("Philips hue bridge"), "serial123", "upc", null), remoteService);
otherDevice = new RemoteDevice(new RemoteDeviceIdentity(new UDN("567"), 60, new URL("http://acme"), null, null), new DeviceType("namespace", "type"), new DeviceDetails("Some Device", new ManufacturerDetails("Taiwan"), new ModelDetails("$%&/"), "serial567", "upc"), remoteService);
} catch (final ValidationException | MalformedURLException ex) {
Assert.fail("Internal test error.");
}
}
use of org.jupnp.model.meta.RemoteDevice in project smarthome by eclipse.
the class FSInternetRadioDiscoveryParticipantJavaTest method noDiscoveryResultIfUnknown.
/**
* Verify no discovery result for unknown device.
*
* @throws ValidationException
* @throws MalformedURLException
*/
@Test
public void noDiscoveryResultIfUnknown() throws MalformedURLException, ValidationException {
RemoteDevice unknownRemoteDevice = createUnknownRemoteDevice();
assertNull(discoveryParticipant.createResult(unknownRemoteDevice));
}
use of org.jupnp.model.meta.RemoteDevice in project smarthome by eclipse.
the class FSInternetRadioDiscoveryParticipantJavaTest method noDiscoveryResultIfNullDetails.
/**
* Verify no discovery result for FSInternetRadio device with null details.
*
* @throws ValidationException
*/
@Test
public void noDiscoveryResultIfNullDetails() throws ValidationException {
RemoteDevice fsInterntRadioDeviceWithNullDetails = new RemoteDevice(null);
assertNull(discoveryParticipant.createResult(fsInterntRadioDeviceWithNullDetails));
}
use of org.jupnp.model.meta.RemoteDevice in project smarthome by eclipse.
the class FSInternetRadioDiscoveryParticipantJavaTest method createUnknownRemoteDevice.
private RemoteDevice createUnknownRemoteDevice() throws ValidationException, MalformedURLException {
int deviceIdentityMaxAgeSeconds = 60;
RemoteDeviceIdentity identity = new RemoteDeviceIdentity(new UDN("unknownUDN"), deviceIdentityMaxAgeSeconds, new URL("http://unknownDescriptorURL"), null, null);
URL anotherBaseURL = new URL("http://unknownBaseUrl");
String friendlyName = "Unknown remote device";
ManufacturerDetails manifacturerDetails = new ManufacturerDetails("UnknownManifacturer");
ModelDetails modelDetails = new ModelDetails("unknownModel");
String serialNumber = "unknownSerialNumber";
DeviceDetails deviceDetails = new DeviceDetails(anotherBaseURL, friendlyName, manifacturerDetails, modelDetails, serialNumber, DEFAULT_UPC, DEFAULT_URI);
final RemoteService remoteService = null;
return new RemoteDevice(identity, DEFAULT_TYPE, deviceDetails, remoteService);
}
Aggregations