throws InvalidPluginConfigurationException, Exception {
Configuration pluginConfig = context.getDefaultPluginConfiguration();
String port = pluginConfig.getSimple("port").getStringValue();
DSPortAdapter adapter = new PDKAdapterUSB();
adapter.selectPort(port);
boolean found = false;
adapter.beginExclusive(true);
found = adapter.adapterDetected();
adapter.endExclusive();
Set<DiscoveredResourceDetails> ret = new HashSet<DiscoveredResourceDetails>();
if (found) {
String key = getIdForAdapter(adapter);
String name = adapter.getAdapterName() + " on " + adapter.getPortName();
log.info("Found " + name + "@[" + key + "]");
String descr = "OneWire adapter (" + name + ") with key (" + key + ")";
DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(), key, name, "",
descr, pluginConfig, null);
ret.add(detail);
adapter.freePort();
}
return ret;
}