gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-15 15:49:31 26 4
gpt4 key购买 nike

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

ZclCluster.setReporting介绍

[英]Configures the reporting for the specified attribute ID for discrete attributes.

minInterval: The minimum reporting interval field is 16 bits in length and shall contain the minimum interval, in seconds, between issuing reports of the specified attribute. If minInterval is set to 0x0000, then there is no minimum limit, unless one is imposed by the specification of the cluster using this reporting mechanism or by the applicable profile.

maxInterval: The maximum reporting interval field is 16 bits in length and shall contain the maximum interval, in seconds, between issuing reports of the specified attribute. If maxInterval is set to 0xffff, then the device shall not issue reports for the specified attribute, and the configuration information for that attribute need not be maintained.
[中]为离散属性的指定属性ID配置报告。
MiniInterval:最小报告间隔字段的长度为16位,并应包含发布指定属性报告之间的最小间隔(以秒为单位)。如果minInterval设置为0x0000,则没有最低限制,除非使用此报告机制的集群规范或适用的配置文件施加了最低限制。
maxInterval:最大报告间隔字段的长度为16位,并应包含发布指定属性报告之间的最大间隔(以秒为单位)。如果maxInterval设置为0xffff,则设备不应发布指定属性的报告,并且不需要维护该属性的配置信息。

代码示例

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

/**
 * Configures the reporting for the specified attribute ID for discrete attributes.
 * <p>
 * <b>minInterval</b>:
 * The minimum reporting interval field is 16 bits in length and shall contain the
 * minimum interval, in seconds, between issuing reports of the specified attribute.
 * If minInterval is set to 0x0000, then there is no minimum limit, unless one is
 * imposed by the specification of the cluster using this reporting mechanism or by
 * the applicable profile.
 * <p>
 * <b>maxInterval</b>:
 * The maximum reporting interval field is 16 bits in length and shall contain the
 * maximum interval, in seconds, between issuing reports of the specified attribute.
 * If maxInterval is set to 0xffff, then the device shall not issue reports for the specified
 * attribute, and the configuration information for that attribute need not be
 * maintained.
 *
 * @param attribute the {@link ZclAttribute} to configure reporting
 * @param minInterval the minimum reporting interval
 * @param maxInterval the maximum reporting interval
 * @return command future {@link CommandResult}
 */
public Future<CommandResult> setReporting(final ZclAttribute attribute, final int minInterval,
    final int maxInterval) {
  return setReporting(attribute, minInterval, maxInterval, null);
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

final ZclAttribute attribute = cluster.getAttribute(attributeId);
final CommandResult result = cluster.setReporting(attribute, 0, 0xFFFF, null).get();
if (result.isSuccess()) {
  final ConfigureReportingResponse response = result.getResponse();

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

final CommandResult result = cluster.setReporting(zclAttribute, 0, 0xffff, reportableChange).get();
if (result.isSuccess()) {
  final ConfigureReportingResponse response = result.getResponse();

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

final CommandResult result = cluster.setReporting(attribute, minInterval, maxInterval, reportableChange).get();
if (result.isSuccess()) {
  final ConfigureReportingResponse response = result.getResponse();

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

final CommandResult result = cluster.setReporting(zclAttribute, minInterval, maxInterval, reportableChange)
    .get();
if (result.isSuccess()) {

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

@Test
public void setReporting() {
  createEndpoint();
  ZclCluster cluster = new ZclOnOffCluster(endpoint);
  ZclAttribute attribute = cluster.getAttribute(0);
  cluster.setReporting(attribute, 22, 33);
  assertEquals(1, commandCapture.getAllValues().size());
  ZigBeeCommand command = commandCapture.getValue();
  assertNotNull(command);
  System.out.println(command);
  assertTrue(command instanceof ConfigureReportingCommand);
  ConfigureReportingCommand cfgCommand = (ConfigureReportingCommand) command;
  assertEquals(1, cfgCommand.getRecords().size());
  AttributeReportingConfigurationRecord record = cfgCommand.getRecords().get(0);
  assertEquals(0, record.getAttributeIdentifier());
  assertEquals(0, record.getDirection());
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com