The ProtocolAdapterInfoExt – com.prosyst.mbs.services.hdm.ProtocolAdapterInfoExt, provides information about supported protocol adapter operation arguments and restrictions. Every protocol adapter has to provide ProtocolAdapterInfo. If the protocol adapter supports the operation for cancel removing the device, this interface will provide this functionality. There is a defined constant – ProtocolAdapterInfoExt.OPERATION_CANCEL_REMOVE, which is used to cancel removing the device.
Also, a method of getOperationInfo(int) exists, which returns protocol operation information – com.prosyst.mbs.services.hdm.OperationInfo. The OperationInfo provides detailed information for the specific protocol adapter operation.
The OperationInfo provides information about:
Protocol adapter operation - the method OperationInfo.getOperation() returns which operations are supported by the protocol adapter. The possible values are:
ProtocolAdapterInfo.OPERATION_ADD
ProtocolAdapterInfo.OPERATION_REMOVE, and
ProtocolAdapterInfoExt.OPERATION_CANCEL_REMOVE
Protocol adapter operation arguments - the method OperationInfo.getArguments() returns the supported arguments by protocol adapter operation. The returned value is a bit mask of the supported operation arguments which are:
OperationInfo.ARGUMENT_REMOVE_RESET
OperationInfo.ARGUMENT_REMOVE_FORCE
OperationInfo.ARGUMENT_REMOVE_POSTPONE
OperationInfo.ARGUMENT_ADD_WITHOUT_DEVICE_CLASSES
Custom specific operation arguments, or
OperationInfo.NO_ARGUMENTS
Types of Remove Arguments
Argument
Description
OperationInfo.ARGUMENT_REMOVE_FORCE
This remove argument is used when the device should be removed immediately. The protocol adapter does not put the device in the removing state. It does not matter if the device is connected or not.
OperationInfo.ARGUMENT_REMOVE_POSTPONE
This remove argument is used when the device should be postpone removed. For example, when the user needs to press a button before removing the device. In this situation the protocol adapter puts the device in HomeDevice.STATUS_REMOVING status and throws NotRemovedException exception to Device Access.
OperationInfo.ARGUMENT_REMOVE_RESET
This remove argument indicates that the device is removed from the device registry and all its data is deleted. It is not used alone, but in combination with the remove arguments described above so that supported remove operation arguments returned from the ProtocolAdapterInfo implementations for a given protocol always match. These combinations are:
OperationInfo.ARGUMENT_REMOVE_RESET and OperationInfo.ARGUMENT_REMOVE_FORCE – the Device should be removed immediately and reset afterwards.
OperationInfo.ARGUMENT_REMOVE_RESET and OperationInfo.ARGUMENT_REMOVE_POSTPONE – the Device should be postpone-removed and reset afterwards.
Protocol adapter operation restrictions – the method OperationInfo.getRestrictions() returns the restriction for the operation as a bit mask of defined restrictions or OperationInfo.NO_RESTRICTIONS. The operation restriction can be:
OperationInfo.RESTRICTION_REMOVE_PARENT, or
Custom specific operation restrictions
Default protocol adapter operation arguments – the OperationInfo.getDefaultArguments() will return as a bit mask of some of the supported operation arguments or OperationInfo.NO_ARGUMENTS. When the operation for removal device without any operation argument(s) is invoked HomeProtocolAdapter.removeHomeDevice(HomeDeviceSpi), the protocol adapter will remove a device with default operation argument(s). For example, if the default remove argument is OperationInfo.ARGUMENT_REMOVE_FORCE and the operation removeHomeDevice(HomeDeviceSpi) is executed, then the protocol adapter has to remove a device immediately.