Previous Topic

Next Topic

Book Contents

Book Index

HomeProtocolAdapterExt

The HomeProtocolAdapterExt – com.prosyst.mbs.services.hdm.spi.HomeProtocolAdapterExt, allows for extending the particular protocol adapter. The DeviceAdmin is calling the HomeProtocolAdapterExt to add new device, to remove available device, to search for new device or cancel device removal using additional operation arguments which are defined by ProtocolAdapterInfoExt.

The functionalities of the HomeProtocolAdapterExt are:

The implementation of this method addHomeDevice(Map<String, ?>, int)allows applications to add new devices and specify additional add operation arguments as a bit mask of the supported ProtocolAdapterInfoExt.

The implementation of the method removeHomeDevice(HomeDeviceSpi, int) forces the adapter to remove the specified device and specify "remove" operation arguments as a bit mask of the supported ProtocolAdapterInfoExt. If the device cannot be removed immediately (for example, user needs to take press a button), the protocol adapter will put the device in the removing status and throw NotRemovedException – com.prosyst.mbs.services.hdm.spi.NotRemovedException, to Device Access. When the protocol adapter throws this exception, this means that the device will be removed later. If the protocol supports operation for cancel removing the device and throws a NotRemovedException, the application might force the protocol adapter to cancel a "device remove" operation by invoking DeviceAdmin.cancelRemove(String) method.

When you implement a protocol adapter which is related to the DA API implementation, the method searchHomeDevice(Map<String, String>, int)does not need to be implemented.

The implementation of this method cancelRemoveHomeDevice(HomeDeviceSpi)forces the adapter to cancel a device removal operation. For example, when the user executes an operation for removing a device and this device is not removed immediately because the user should press a button. In this situation the protocol adapter sets the device in a removing state. Then the user might execute this operation for canceling the remove operation.