Previous Topic

Next Topic

Book Contents

Book Index

Removing a Device

After you create a device (see Creating a Device) you can remove and unregister the available devices from the system. You can remove a device with the given UID. The removal process finishes when the Device and its Device Items are removed and unregistered from the system.

The following examples show how you can removed the created devices. These examples use . For this reason you should install and start it.

By Invoking the DeviceAdmin.OPERATION_REMOVE Operation

Invoke the DeviceAdmin.OPERATION_REMOVE operation with parameter UID of the Device which is to be removed.

private DeviceAdmin deviceAdmin;

public void remove(String deviceUID) {

  deviceAdmin.remove(deviceUID);

}

By Invoking the DeviceAdmin.OPERATION_REMOVE_DEVICE Operation

Removes the specified Device with remove operation argument, specified from the application by invoke the DeviceAdmin.OPERATION_REMOVE_DEVICE operation with the following parameters:

Details about the removal arguments can be found in the Adapter Information guide. The removeArgument is specified from the application. This removal argument must be supported by the protocol adapter. If the adapter does not support the provided removal argument, the Device Access throws an exception. The Device Access Protocol Adapter Demo does not support any removal arguments.

Operation DeviceAdmin.OPERATION_CANCEL_REMOVE

The execution of this method forces the protocol adapter to cancel a remove operation. If the protocol adapter does not support this operation, the DeviceAdmin throws an exception. If the protocol adapter supports the operation, then you invoke it with a UID parameter of the removing Device.

The Device Access Protocol Adapter Demo does not support this operation.

This operation does not throw the FunctionalItem event when the operation is executed.