本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclAttribute.isWritable()
方法的一些代码示例,展示了ZclAttribute.isWritable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZclAttribute.isWritable()
方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.zcl.ZclAttribute
类名称:ZclAttribute
方法名:isWritable
[英]Returns true if this attribute is writable
[中]如果此属性可写,则返回true
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
private void printAttributes(final ZclCluster cluster, final PrintStream out) {
Map<Integer, ZclAttribute> attributeTree = new TreeMap<Integer, ZclAttribute>();
for (ZclAttribute attribute : cluster.getAttributes()) {
attributeTree.put(attribute.getId(), attribute);
}
for (ZclAttribute attribute : attributeTree.values()) {
out.println(String.format(" %s %5d %s%s%s %s %-40s %s %s",
(cluster.getSupportedAttributes().contains(attribute.getId()) ? "S" : "U"), attribute.getId(),
(attribute.isReadable() ? "r" : "-"), (attribute.isWritable() ? "w" : "-"),
(attribute.isReportable() ? "s" : "-"), printZclDataType(attribute.getDataType()),
attribute.getName(),
(attribute.getLastValue() == null ? "" : attribute.getLastReportTime().getTime()),
(attribute.getLastValue() == null ? "" : attribute.getLastValue())));
}
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void testConstructor() {
ZclAttribute attribute = new ZclAttribute(ZclClusterType.ON_OFF, 0, "Test Name",
ZclDataType.UNSIGNED_8_BIT_INTEGER, false, false, false, false);
assertEquals(ZclClusterType.ON_OFF, attribute.getCluster());
assertEquals(0, attribute.getId());
assertEquals("Test Name", attribute.getName());
assertEquals(ZclDataType.UNSIGNED_8_BIT_INTEGER, attribute.getDataType());
assertEquals(false, attribute.isMandatory());
assertEquals(false, attribute.isWritable());
assertEquals(false, attribute.isReadable());
assertEquals(false, attribute.isReportable());
System.out.println(attribute.toString());
attribute = new ZclAttribute(ZclClusterType.ON_OFF, 0, "Test Name", ZclDataType.UNSIGNED_8_BIT_INTEGER, true,
true, true, true);
assertEquals(true, attribute.isMandatory());
assertEquals(true, attribute.isWritable());
assertEquals(true, attribute.isReadable());
assertEquals(true, attribute.isReportable());
System.out.println(attribute.toString());
}
内容来源于网络,如有侵权,请联系作者删除!