You can send a request to a protocol adapter to launch a search for devices through the associated protocol. The search might result in detection of new devices or in removal of not available ones.
To launch a search for home devices in the network:
Retrieve the Home Device Admin service ().
Invoke the searchHomeDevices method of the Home Device Admin passing the following arguments:
ProtocolAdapterInfo adapterInfo - The representation for the protocol adapter responsible for contacting the device matching the specified properties. To involve all adapters, pass null.
java.util.Map searchProperties - A Map holding some of the following device properties (constants in com.prosyst.mbs.services.hdm.HomeDevice) as attributes:
VENDOR, VERSION and DEVICE_CLASSES
Adapter-specific properties - You can retrieve the list of the properties for the adapter by using the getProperties or getPropertyMetadata method of the corresponding ProtocolAdapterInfo object.
The search operation will be executed asynchronously. If you want to know if a device is added or removed as a result of the search, register an Event Handler compliant with the OSGi Event Admin service that will listen for events with HomeDeviceEventConstants.TOPIC_HOME_DEVICE_ADDED or HomeDeviceEventConstants.TOPIC_HOME_DEVICE_REMOVED topics. For more information refer to Receiving Events about Changes in the Devices.