更新时间:2022-02-24 GMT+08:00

IotaMessage类说明

1
2
3
4
bind后接收响应获取appiddeviceidsecret
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
上报数据收到响应:
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
命令接收:
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
设备添加收到响应(ret = 0表示成功):
String deviceId =iotaMsg.getString(HubService.HUB_IE_DEVICEID);
int ret = iotaMsg.getUint(HubService.HUB_IE_RESULT, HubService.HUB_RESULT_FAILED);

1
2
3
设备删除收到响应(result = 0表示成功):
int result = iotaMsg.getUint(HubService.HUB_IE_RESULT, 0);
int cookie = iotaMsg.getUint(HubService.HUB_IE_COOKIE, 0);

1
2
3
更新设备状态收到响应(result = 0表示成功):
int result = iotaMsg.getUint(HubService.HUB_IE_RESULT, 0);
int cookie = iotaMsg.getUint(HubService.HUB_IE_COOKIE, 0);

1
2
收到设备登出 (错误码信息对照loginService定义)
int reason = iotaMsg.getUint(LoginService.LOGIN_IE_RESULT, -1);