本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclStatus
类的一些代码示例,展示了ZclStatus
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZclStatus
类的具体详情如下:
包路径:com.zsmartsystems.zigbee.zcl.ZclStatus
类名称:ZclStatus
[英]Defines the ZigBee Cluster Library status values and descriptions
[中]定义ZigBee群集库状态值和描述
代码示例来源: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
out.println("Group name: " + response.getGroupName());
} else {
final ZclStatus status = ZclStatus.getStatus((byte) statusCode);
out.println("Error reading group name: " + status);
代码示例来源: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
@Override
public void deserialize(final ZigBeeDeserializer deserializer) {
attributeIdentifier = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_16_BIT_INTEGER);
status = (ZclStatus) deserializer.readZigBeeType(ZclDataType.ZCL_STATUS);
if (status.equals(ZclStatus.SUCCESS)) {
attributeDataType = ZclDataType
.getType((int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER));
attributeValue = deserializer.readZigBeeType(attributeDataType);
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void getDescription() {
assertEquals("Operation was successful.", ZclStatus.SUCCESS.getDescription());
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void getStatus() {
assertEquals(ZclStatus.SUCCESS, ZclStatus.getStatus(0));
assertEquals(ZclStatus.UNKNOWN, ZclStatus.getStatus(999));
}
}
代码示例来源: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
out.println("Attribute value write success.");
} else {
final ZclStatus status = ZclStatus.getStatus((byte) statusCode);
out.println("Attribute value write error: " + status);
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
break;
case ZCL_STATUS:
buffer[length++] = ((ZclStatus) data).getId();
break;
case BYTE_ARRAY:
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
break;
case ZCL_STATUS:
value[0] = ZclStatus.getStatus(payload[index++]);
break;
case ZDO_STATUS:
内容来源于网络,如有侵权,请联系作者删除!