gpt4 book ai didi

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

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

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

ZclCluster.getClusterId介绍

[英]Gets the cluster ID for this cluster
[中]获取此群集的群集ID

代码示例

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

/**
 * Adds a specific {@link ZclCluster} to the input clusters in this endpoint.
 *
 * @param cluster the {@link ZclCluster} to add
 * @return true if the cluster was added, false if there was an error (eg the cluster was already included in the
 *         endpoint)
 */
public boolean addInputCluster(ZclCluster cluster) {
  if (inputClusters.containsKey(cluster.getClusterId())) {
    return false;
  }
  inputClusters.put(cluster.getClusterId(), cluster);
  return true;
}

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

/**
 * Adds a specific {@link ZclCluster} to the output clusters in this endpoint.
 *
 * @param cluster the {@link ZclCluster} to add
 * @return true if the cluster was added, false if there was an error (eg the cluster was already included in the
 *         endpoint)
 */
public boolean addOutputCluster(ZclCluster cluster) {
  if (outputClusters.containsKey(cluster.getClusterId())) {
    return false;
  }
  outputClusters.put(cluster.getClusterId(), cluster);
  return true;
}

代码示例来源:origin: openhab/org.openhab.binding.zigbee

@SuppressWarnings("unchecked")
private ZclClusterConfigHandler getClusterConfigHandler(ZclCluster cluster)
    throws NoSuchMethodException, SecurityException, InstantiationException, IllegalAccessException,
    IllegalArgumentException, InvocationTargetException {
  Constructor<? extends ZclClusterConfigHandler> constructor;
  Class<?> converterClass = configMap.get(cluster.getClusterId());
  if (converterClass == null) {
    return null;
  }
  constructor = (Constructor<? extends ZclClusterConfigHandler>) converterClass.getConstructor();
  ZclClusterConfigHandler converter = constructor.newInstance();
  if (converter.initialize(cluster)) {
    return converter;
  }
  return null;
}

代码示例来源:origin: openhab/org.openhab.binding.zigbee

@Override
public void disposeConverter() {
  for (ZclCluster clientCluster : clientClusters) {
    logger.debug("{}: Closing cluster {}", endpoint.getIeeeAddress(), clientCluster.getClusterId());
    clientCluster.removeCommandListener(this);
  }
}

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

/**
 * @param cluster a ZCL cluster
 * @return a String containing information about the cluster, example 'OnOff server cluster 0x00A4'
 */
protected String printCluster(ZclCluster cluster) {
  String typePrefix = cluster.isServer() ? "server" : "client";
  return String.format("%s cluster %s (%s)", typePrefix, cluster.getClusterName(),
      printClusterId(cluster.getClusterId()));
}

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

private void printClusters(final ZigBeeEndpoint endpoint, final boolean input, final PrintStream out) {
  Collection<Integer> clusters;
  if (input) {
    clusters = endpoint.getInputClusterIds();
  } else {
    clusters = endpoint.getOutputClusterIds();
  }
  Map<Integer, ZclCluster> clusterTree = new TreeMap<Integer, ZclCluster>();
  for (Integer clusterId : clusters) {
    ZclCluster cluster;
    if (input) {
      cluster = endpoint.getInputCluster(clusterId);
    } else {
      cluster = endpoint.getOutputCluster(clusterId);
    }
    clusterTree.put(cluster.getClusterId(), cluster);
  }
  for (ZclCluster cluster : clusterTree.values()) {
    out.println("   " + printClusterId(cluster.getClusterId()) + " " + cluster.getClusterName());
    printAttributes(cluster, out);
  }
}

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

if (newList.contains(cluster.getClusterId())) {
removeIds.add(cluster.getClusterId());

代码示例来源:origin: openhab/org.openhab.binding.zigbee

int clusterId = commandSpec.getClusterId();
if (clientClusters.stream().anyMatch(cluster -> cluster.getClusterId().intValue() == clusterId)) {

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

@Test
public void getClusterId() {
  createEndpoint();
  ZclCluster cluster = new ZclOnOffCluster(endpoint);
  assertEquals(Integer.valueOf(6), cluster.getClusterId());
}

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