- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclAttribute.getDataType()
方法的一些代码示例,展示了ZclAttribute.getDataType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZclAttribute.getDataType()
方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.zcl.ZclAttribute
类名称:ZclAttribute
方法名:getDataType
[英]Gets the ZigBeeType of this attribute
[中]获取此属性的类型
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Write an attribute
*
* @param attribute the {@link ZclAttribute} to write
* @param value the value to set (as {@link Object})
* @return command future {@link CommandResult}
*/
public Future<CommandResult> write(final ZclAttribute attribute, final Object value) {
return write(attribute.getId(), attribute.getDataType(), value);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
private void updateAttribute(int attributeId, Object attributeValue) {
ZclAttribute attribute = attributes.get(attributeId);
if (attribute == null) {
logger.debug("{}: Unknown attribute {} in cluster {}", zigbeeEndpoint.getEndpointAddress(), attributeId,
clusterId);
} else {
attribute.updateValue(normalizer.normalizeZclData(attribute.getDataType(), attributeValue));
notifyAttributeListener(attribute);
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void process(ZigBeeNetworkManager networkManager, String[] args, PrintStream out)
throws IllegalArgumentException, InterruptedException, ExecutionException {
if (args.length != 3) {
throw new IllegalArgumentException("Invalid number of arguments");
}
final ZigBeeEndpoint endpoint = getEndpoint(networkManager, args[1]);
ZclCluster cluster = getCluster(endpoint, args[2]);
final Future<Boolean> future = cluster.discoverAttributes(false);
Boolean result = future.get();
if (result) {
out.println("Supported attributes for " + printCluster(cluster));
out.println("AttrId Data Type Name");
for (Integer attributeId : cluster.getSupportedAttributes()) {
out.print(" ");
ZclAttribute attribute = cluster.getAttribute(attributeId);
out.print(printAttributeId(attributeId));
if (attribute != null) {
out.print(" " + printZclDataType(attribute.getDataType()) + " " + attribute.getName());
}
out.println();
}
} else {
out.println("Failed to retrieve supported attributes");
}
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Read an attribute
*
* @param attribute the {@link ZclAttribute} to read
* @return
*/
protected Object readSync(final ZclAttribute attribute) {
logger.debug("readSync request: {}", attribute);
CommandResult result;
try {
result = read(attribute).get();
} catch (InterruptedException e) {
logger.debug("readSync interrupted");
return null;
} catch (ExecutionException e) {
logger.debug("readSync exception ", e);
return null;
}
if (!result.isSuccess()) {
return null;
}
ReadAttributesResponse response = result.getResponse();
if (response.getRecords().get(0).getStatus() == ZclStatus.SUCCESS) {
ReadAttributeStatusRecord attributeRecord = response.getRecords().get(0);
return normalizer.normalizeZclData(attribute.getDataType(), attributeRecord.getAttributeValue());
}
return null;
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
Object reportableChange = null;
if (args.length > 6) {
reportableChange = parseValue(args[6], attribute.getDataType());
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
Object reportableChange = null;
if (args.length > 4) {
reportableChange = parseValue(args[4], attribute.getDataType());
代码示例来源: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
final Object value = parseValue(attributeValueParam, attribute.getDataType());
final CommandResult result = cluster.write(attribute, value).get();
if (result.isSuccess()) {
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
reportableChange = parseValue(reportableChangeParam, attribute.getDataType());
} else {
reportableChange = null;
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void handleAttributeReport() {
createEndpoint();
ZclCluster cluster = new ZclOnOffCluster(endpoint);
ZclAttributeListener listenerMock = Mockito.mock(ZclAttributeListener.class);
ArgumentCaptor<ZclAttribute> attributeCapture = ArgumentCaptor.forClass(ZclAttribute.class);
cluster.addAttributeListener(listenerMock);
cluster.addAttributeListener(listenerMock);
List<AttributeReport> attributeList = new ArrayList<AttributeReport>();
AttributeReport report;
report = new AttributeReport();
report.setAttributeDataType(ZclDataType.SIGNED_8_BIT_INTEGER);
report.setAttributeIdentifier(0);
report.setAttributeValue(Integer.valueOf(1));
System.out.println(report);
attributeList.add(report);
cluster.handleAttributeReport(attributeList);
ZclAttribute attribute = cluster.getAttribute(0);
assertTrue(attribute.getLastValue() instanceof Boolean);
Mockito.verify(listenerMock, Mockito.timeout(1000).times(1)).attributeUpdated(attributeCapture.capture());
attribute = attributeCapture.getValue();
assertTrue(attribute.getLastValue() instanceof Boolean);
assertEquals(ZclDataType.BOOLEAN, attribute.getDataType());
assertEquals(0, attribute.getId());
assertEquals(true, attribute.getLastValue());
cluster.removeAttributeListener(listenerMock);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
record.setDirection(0);
record.setAttributeIdentifier(attribute.getId());
record.setAttributeDataType(attribute.getDataType());
record.setMinimumReportingInterval(minInterval);
record.setMaximumReportingInterval(maxInterval);
代码示例来源: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());
}
本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclAttribute.isLastValueCurrent()方法的一些代码示例,展示了ZclAttribute.is
本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclAttribute.getLastReportTime()方法的一些代码示例,展示了ZclAttribute.get
本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclAttribute.getId()方法的一些代码示例,展示了ZclAttribute.getId()的具体用法。这些
本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclAttribute.isReadable()方法的一些代码示例,展示了ZclAttribute.isReadable
本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclAttribute.getCluster()方法的一些代码示例,展示了ZclAttribute.getCluster
本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclAttribute.getDataType()方法的一些代码示例,展示了ZclAttribute.getDataTy
本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclAttribute.getLastValue()方法的一些代码示例,展示了ZclAttribute.getLastV
本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclAttribute.isWritable()方法的一些代码示例,展示了ZclAttribute.isWritable
本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclAttribute.getName()方法的一些代码示例,展示了ZclAttribute.getName()的具体用
我是一名优秀的程序员,十分优秀!