gpt4 book ai didi

com.zsmartsystems.zigbee.zcl.protocol.ZclDataType.isAnalog()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 07:03:31 25 4
gpt4 key购买 nike

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

ZclDataType.isAnalog介绍

暂无

代码示例

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

@Override
  public String toString() {
    StringBuilder builder = new StringBuilder(220);

    builder.append("AttributeReportingConfigurationRecord: [attributeDataType=");
    builder.append(attributeDataType);
    builder.append(", attributeIdentifier=");
    builder.append(attributeIdentifier);
    builder.append(", direction=");
    builder.append(direction);
    if (direction == 0) {
      builder.append(", minimumReportingInterval=");
      builder.append(minimumReportingInterval);
      builder.append(", maximumReportingInterval=");
      builder.append(maximumReportingInterval);
      if (attributeDataType.isAnalog()) {
        builder.append(", reportableChange=");
        builder.append(reportableChange);
      }
    } else if (direction == 1) {
      builder.append(", timeoutPeriod=");
      builder.append(timeoutPeriod);
    }
    builder.append(']');

    return builder.toString();
  }
}

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

@Test
public void isAnalog() {
  ZclDataType type = ZclDataType.BOOLEAN;
  assertFalse(type.isAnalog());
  type = ZclDataType.UNSIGNED_16_BIT_INTEGER;
  assertTrue(type.isAnalog());
}

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

@Override
public void serialize(final ZigBeeSerializer serializer) {
  serializer.appendZigBeeType(direction, ZclDataType.UNSIGNED_8_BIT_INTEGER);
  serializer.appendZigBeeType(attributeIdentifier, ZclDataType.UNSIGNED_16_BIT_INTEGER);
  if (direction == 1) {
    // If direction is set to 0x01, then the timeout period field is included in the payload,
    // and the attribute data type field, the minimum reporting interval field, the
    // maximum reporting interval field and the reportable change field are omitted. The
    // record is sent to a cluster client (or server) to configure how it should expect
    // reports from a server (or client) of the same cluster.
    serializer.appendZigBeeType(timeoutPeriod, ZclDataType.UNSIGNED_16_BIT_INTEGER);
  } else {
    // If direction is set to 0x00, then the attribute data type field, the minimum
    // reporting interval field, the maximum reporting interval field and the reportable
    // change field are included in the payload, and the timeout period field is omitted.
    // The record is sent to a cluster server (or client) to configure how it sends reports to
    // a client (or server) of the same cluster.
    serializer.appendZigBeeType(attributeDataType.getId(), ZclDataType.UNSIGNED_8_BIT_INTEGER);
    serializer.appendZigBeeType(minimumReportingInterval, ZclDataType.UNSIGNED_16_BIT_INTEGER);
    serializer.appendZigBeeType(maximumReportingInterval, ZclDataType.UNSIGNED_16_BIT_INTEGER);
    // The reportable change field shall contain the minimum change to the attribute that
    // will result in a report being issued. This field is of variable length. For attributes
    // with 'analog' data typethe field has the same data type as the attribute. The sign (if any) of the
    // reportable change field is ignored. For attributes of 'discrete' data type this field is omitted.
    if (attributeDataType.isAnalog()) {
      serializer.appendZigBeeType(reportableChange, attributeDataType);
    }
  }
}

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

@Override
public void deserialize(final ZigBeeDeserializer deserializer) {
  direction = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER);
  attributeIdentifier = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_16_BIT_INTEGER);
  if (direction == 1) {
    // If direction is set to 0x01, then the timeout period field is included in the payload,
    // and the attribute data type field, the minimum reporting interval field, the
    // maximum reporting interval field and the reportable change field are omitted. The
    // record is sent to a cluster client (or server) to configure how it should expect
    // reports from a server (or client) of the same cluster.
    timeoutPeriod = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_16_BIT_INTEGER);
  } else {
    // If direction is set to 0x00, then the attribute data type field, the minimum
    // reporting interval field, the maximum reporting interval field and the reportable
    // change field are included in the payload, and the timeout period field is omitted.
    // The record is sent to a cluster server (or client) to configure how it sends reports to
    // a client (or server) of the same cluster.
    attributeDataType = ZclDataType
        .getType((int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER));
    minimumReportingInterval = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_16_BIT_INTEGER);
    maximumReportingInterval = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_16_BIT_INTEGER);
    if (attributeDataType.isAnalog()) {
      // The reportable change field shall contain the minimum change to the attribute that
      // will result in a report being issued. This field is of variable length. For attributes
      // with 'analog' data typethe field has the same data type as the attribute. The sign (if any) of the
      // reportable change field is ignored. For attributes of 'discrete' data type this field is omitted.
      reportableChange = deserializer.readZigBeeType(attributeDataType);
    }
  }
}

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