Help Center > > API Reference> AgentLite API Reference (Java)> APIs> Management of Non-Directly Connected Devices on a Gateway> Deleting a Device

Deleting a Device

Updated at: Aug 28, 2019 GMT+08:00

API Function

This API is used to delete indirectly connected devices from the IoT platform when a new device needs to be removed from the gateway.

API Description

1
public static boolean rmvDevice(int cookie, String deviceId);

Class

HubService

Parameter Description

Parameter

Mandatory or Optional

Type

Description

cookie

Optional

int

The value ranges from 1 to 65535.

deviceId

Mandatory

String

Identifies a device.

Return Value

Return Value

Description

true

Success

false

Failure

NOTE:

Return values only show API calling results. For example, the return value true indicates that the API is called successfully but does not indicate that the device is deleted successfully. The device is deleted successfully only after the HubService broadcast is received.

Example

Call this API to delete a device.

1
HubService.rmvDevice(122, deviceId);

Implement the observer API provided by the AgentLite before calling this API.

1
2
3
4
5
6
public class Subscribe implements MyObserver {
    public Subscribe (Observable hubService) {
        hubService. registerObserver (this);
    }
    @Override
Same as those used for adding a device.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel