Deleting a Device
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 |
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.
|
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot