设备管理 IOTDM(联通用户专用)-删除设备:示例

时间:2024-07-03 16:54:05

示例

开发者调用该接口进行设备删除 。

1
HubService.rmvDevice(122, deviceId);

结果处理:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
//java code 
BroadcastReceiver mRmvdeviceRsp;
mRmvdeviceRsp = new BroadcastReceiver() {
    @Override 
     public void onReceive(Context context, Intent intent) {
        //Do Something 
        IotaMessage iotaMsg = (IotaMessage)intent.getSerializableExtra(HubService. HUB_BROADCAST_IE_IOTAMSG);
        int result = iotaMsg.getUint(HubService.HUB_IE_RESULT, 0);
        int cookie = iotaMsg.getUint(HubService.HUB_IE_COOKIE, 0);
        return;
    }
};
mLocalBroadcastManager = LocalBroadcastManager.getInstance(this);
IntentFilter filterRmvDev = new IntentFilter(HubService.TOPIC_RMVDEV_RSP);
mLocalBroadcastManager.registerReceiver(mDeldeviceRsp, filterRmvDev);
support.huaweicloud.com/sdkreference-iot/iot_06_1018.html