com.zsmartsystems.zigbee.zcl.ZclCluster.handleAttributeReport()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclCluster.handleAttributeReport()方法的一些代码示例,展示了ZclCluster.handleAttributeReport()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZclCluster.handleAttributeReport()方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.zcl.ZclCluster
类名称:ZclCluster
方法名:handleAttributeReport

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);
}

相关文章