本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclCluster.handleAttributeReport()
方法的一些代码示例,展示了ZclCluster.handleAttributeReport()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZclCluster.handleAttributeReport()
方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.zcl.ZclCluster
类名称:ZclCluster
方法名:handleAttributeReport
[英]Processes a list of attribute reports for this cluster
[中]处理此群集的属性报告列表
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
cluster.handleAttributeReport(attributeCommand.getReports());
return;
代码示例来源: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);
}
内容来源于网络,如有侵权,请联系作者删除!