Updated on 2022-02-24 GMT+08:00

IotaMessage Class

1
2
3
4
Obtain appId, deviceId, and secret from the response returned after the device is bound successfully.
String appId = iotaMsg.getString(BindService.BIND_IE_APPID);
String deviceId = iotaMsg.getString(BindService.BIND_IE_DEVICEID);
String secret = iotaMsg.getString(BindService.BIND_IE_DEVICESECRET);

1
2
3
4
Receive a response for data reporting.
String deviceId = iotaMsg.getString(DataTransService.DATATRANS_IE_DEVICEID);
int retcode = iotaMsg.getUint(DataTransService.DATATRANS_IE_RESULT, 0);
intcookie = iotaMsg.getUint(DataTransService.DATATRANS_IE_COOKIE, 0);

1
2
3
4
5
6
Receive a command.
String deviceId = iotaMsg.getString(DataTransService.DATATRANS_IE_DEVICEID);
String requestId = iotaMsg.getString(DataTransService.DATATRANS_IE_REQUSTID);
String serviceId = iotaMsg.getString(DataTransService.DATATRANS_IE_SERVICEID);
String method = iotaMsg.getString(DataTransService.DATATRANS_IE_METHOD);
String cmd = iotaMsg.getString(DataTransService.DATATRANS_IE_CMDCONTENT);

1
2
3
Receive a response for device adding. (If ret is 0, the device is added successfully.)
String deviceId =iotaMsg.getString(HubService.HUB_IE_DEVICEID);
int ret = iotaMsg.getUint(HubService.HUB_IE_RESULT, HubService.HUB_RESULT_FAILED);

1
2
3
Receive a response for device deleting. (If result is 0, the device is deleted successfully.)
int result = iotaMsg.getUint(HubService.HUB_IE_RESULT, 0);
int cookie = iotaMsg.getUint(HubService.HUB_IE_COOKIE, 0);

1
2
3
Receive a response for device status update. (If result is 0, the device status is updated successfully.)
int result = iotaMsg.getUint(HubService.HUB_IE_RESULT, 0);
int cookie = iotaMsg.getUint(HubService.HUB_IE_COOKIE, 0);

1
2
Receive a response for device logout. (The error code information is defined by referring to loginService.)
int reason = iotaMsg.getUint(LoginService.LOGIN_IE_RESULT, -1);