本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclStatus.getId()
方法的一些代码示例,展示了ZclStatus.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZclStatus.getId()
方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.zcl.ZclStatus
类名称:ZclStatus
方法名:getId
[英]Gets the integer status ID for this code
[中]获取此代码的整数状态ID
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public String toString() {
StringBuilder builder = new StringBuilder(60);
builder.append("CommandResult [");
if (isSuccess()) {
builder.append("SUCCESS, ");
builder.append(response);
} else if (isTimeout()) {
builder.append("TIMEOUT");
} else {
final ZclStatus status = ZclStatus.getStatus((byte) getStatusCode().intValue());
builder.append("ERROR (");
builder.append(status.name());
builder.append(String.format(",0x%02X), ", status.getId()));
builder.append(response);
}
builder.append(']');
return builder.toString();
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void getId() {
assertEquals(0x00, ZclStatus.SUCCESS.getId());
assertEquals(0x01, ZclStatus.FAILURE.getId());
assertEquals(0x7E, ZclStatus.NOT_AUTHORIZED.getId());
assertEquals(0x88, ZclStatus.READ_ONLY.getId());
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Gets status code received in default response.
*
* @return the status code as {@link Integer}
*/
public Integer getStatusCode() {
if (hasStatusCode()) {
if (response instanceof DefaultResponse) {
return ((DefaultResponse) response).getStatusCode().getId();
} else {
return ((ZdoResponse) response).getStatus().getId();
}
} else {
return 0xffff;
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
break;
case ZCL_STATUS:
buffer[length++] = ((ZclStatus) data).getId();
break;
case BYTE_ARRAY:
内容来源于网络,如有侵权,请联系作者删除!