gpt4 book ai didi

com.zsmartsystems.zigbee.ZigBeeEndpoint.getInputClusterIds()方法的使用及代码示例

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

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

ZigBeeEndpoint.getInputClusterIds介绍

[英]Gets input cluster IDs. This lists the IDs of all clusters the device supports as a server.
[中]获取输入群集ID。这将列出设备作为服务器支持的所有群集的ID。

代码示例

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

@Override
  public String toString() {
    return "ZigBeeEndpoint [networkAddress=" + getEndpointAddress().toString() + ", profileId="
        + String.format("%04X", profileId) + ", deviceId=" + deviceId + ", deviceVersion=" + deviceVersion
        + ", inputClusterIds=" + getInputClusterIds().toString() + ", outputClusterIds="
        + getOutputClusterIds().toString() + "]";
  }
}

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

private void outputEndpoint(PrintStream out, ZigBeeEndpoint endpoint) {
    out.println("Profile     " + String.format("%04X ", endpoint.getProfileId())
        + ZigBeeProfileType.getByValue(endpoint.getProfileId()));
    out.println("                 : Device Type " + String.format("%04X ", endpoint.getDeviceId())
        + com.zsmartsystems.zigbee.ZigBeeDeviceType.getByValue(endpoint.getDeviceId()).toString());
    for (Integer clusterId : endpoint.getInputClusterIds()) {
      out.println("                   -> " + ZclClusterType.getValueById(clusterId));
    }
    for (Integer clusterId : endpoint.getOutputClusterIds()) {
      out.println("                   <- " + ZclClusterType.getValueById(clusterId));
    }
  }
}

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

public List<ZclClusterConfigHandler> getConfigHandlers(ZigBeeEndpoint endpoint) {
  List<ZclClusterConfigHandler> handlers = new ArrayList<>();
  for (int clusterId : endpoint.getInputClusterIds()) {
    try {
      ZclClusterConfigHandler handler = getClusterConfigHandler(endpoint.getInputCluster(clusterId));
      if (handler != null) {
        handlers.add(handler);
      }
    } catch (InstantiationException | IllegalAccessException | IllegalArgumentException
        | InvocationTargetException | NoSuchMethodException | SecurityException e) {
      logger.debug("{}: Exception while getting config for input cluster {}: ", endpoint.getIeeeAddress(),
          clusterId, e);
    }
  }
  for (int clusterId : endpoint.getOutputClusterIds()) {
    try {
      ZclClusterConfigHandler handler = getClusterConfigHandler(endpoint.getOutputCluster(clusterId));
      if (handler != null) {
        handlers.add(handler);
      }
    } catch (InstantiationException | IllegalAccessException | IllegalArgumentException
        | InvocationTargetException | NoSuchMethodException | SecurityException e) {
      logger.debug("{}: Exception while getting config for output cluster {}: ", endpoint.getIeeeAddress(),
          clusterId, e);
    }
  }
  return handlers;
}

代码示例来源: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: openhab/org.openhab.binding.zigbee

staticClusters = processClusterList(endpoint.getInputClusterIds(),
    properties.get(ZigBeeBindingConstants.CHANNEL_PROPERTY_INPUTCLUSTERS));
if (!staticClusters.isEmpty()) {

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

@Test
public void testInputClusterIds() {
  ZigBeeEndpoint endpoint = getEndpoint();
  List<Integer> clusterIdList = new ArrayList<Integer>();
  clusterIdList.add(ZclAlarmsCluster.CLUSTER_ID);
  clusterIdList.add(ZclBasicCluster.CLUSTER_ID);
  clusterIdList.add(ZclColorControlCluster.CLUSTER_ID);
  clusterIdList.add(ZclDoorLockCluster.CLUSTER_ID);
  clusterIdList.add(ZclLevelControlCluster.CLUSTER_ID);
  endpoint.setInputClusterIds(clusterIdList);
  assertEquals(5, endpoint.getInputClusterIds().size());
  assertNotNull(endpoint.getInputCluster(ZclAlarmsCluster.CLUSTER_ID));
  assertFalse(endpoint.getInputCluster(ZclAlarmsCluster.CLUSTER_ID).isClient());
  assertTrue(endpoint.getInputCluster(ZclAlarmsCluster.CLUSTER_ID).isServer());
  assertNotNull(endpoint.getInputCluster(ZclLevelControlCluster.CLUSTER_ID));
  assertFalse(endpoint.getInputCluster(ZclLevelControlCluster.CLUSTER_ID).isClient());
  assertTrue(endpoint.getInputCluster(ZclLevelControlCluster.CLUSTER_ID).isServer());
  assertTrue(endpoint.addInputCluster(new ZclScenesCluster(endpoint)));
  assertFalse(endpoint.addInputCluster(new ZclScenesCluster(endpoint)));
  assertTrue(endpoint.getInputClusterIds().contains(ZclScenesCluster.CLUSTER_ID));
  assertTrue(endpoint.getOutputClusterIds().isEmpty());
}

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

@Test
public void testOutputClusterIds() {
  ZigBeeEndpoint endpoint = getEndpoint();
  List<Integer> clusterIdList = new ArrayList<Integer>();
  clusterIdList.add(ZclAlarmsCluster.CLUSTER_ID);
  clusterIdList.add(ZclBasicCluster.CLUSTER_ID);
  clusterIdList.add(ZclColorControlCluster.CLUSTER_ID);
  clusterIdList.add(ZclDoorLockCluster.CLUSTER_ID);
  clusterIdList.add(ZclLevelControlCluster.CLUSTER_ID);
  endpoint.setOutputClusterIds(clusterIdList);
  assertEquals(5, endpoint.getOutputClusterIds().size());
  assertNotNull(endpoint.getOutputCluster(ZclAlarmsCluster.CLUSTER_ID));
  assertTrue(endpoint.getOutputCluster(ZclAlarmsCluster.CLUSTER_ID).isClient());
  assertFalse(endpoint.getOutputCluster(ZclAlarmsCluster.CLUSTER_ID).isServer());
  assertNotNull(endpoint.getOutputCluster(ZclLevelControlCluster.CLUSTER_ID));
  assertTrue(endpoint.getOutputCluster(ZclLevelControlCluster.CLUSTER_ID).isClient());
  assertFalse(endpoint.getOutputCluster(ZclLevelControlCluster.CLUSTER_ID).isServer());
  clusterIdList = new ArrayList<Integer>();
  clusterIdList.add(ZclAlarmsCluster.CLUSTER_ID);
  clusterIdList.add(ZclBasicCluster.CLUSTER_ID);
  assertTrue(endpoint.getOutputCluster(ZclAlarmsCluster.CLUSTER_ID).isClient());
  assertFalse(endpoint.getOutputCluster(ZclLevelControlCluster.CLUSTER_ID).isServer());
  assertTrue(endpoint.addOutputCluster(new ZclScenesCluster(endpoint)));
  assertFalse(endpoint.addOutputCluster(new ZclScenesCluster(endpoint)));
  assertTrue(endpoint.getOutputClusterIds().contains(ZclScenesCluster.CLUSTER_ID));
  assertTrue(endpoint.getInputClusterIds().isEmpty());
  System.out.println(endpoint.toString());
}

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