gpt4 book ai didi

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

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

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

ZclClusterType.getValueById介绍

暂无

代码示例

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

/**
 * Adds a cluster to the list of clusters we will match
 *
 * @param cluster the cluster to match
 */
public void addCluster(int cluster) {
  logger.debug("ClusterMatcher adding cluster {}", ZclClusterType.getValueById(cluster));
  clusters.add(cluster);
}

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

@Override
  public String toString() {
    Integer resolvedClusterId = getClusterId();
    final StringBuilder builder = new StringBuilder();
    builder.append(ZclClusterType.getValueById(resolvedClusterId).getLabel());
    builder.append(": ");
    builder.append(super.toString());
    return builder.toString();
  }
}

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

private ZclCluster getClusterClass(int clusterId) {
  ZclClusterType clusterType = ZclClusterType.getValueById(clusterId);
  if (clusterType == null) {
    // Unsupported cluster
    logger.debug("{}: Unsupported cluster {}", getEndpointAddress(), clusterId);
    return null;
  }
  // Create a cluster class
  ZclCluster cluster = null;
  Constructor<? extends ZclCluster> constructor;
  try {
    constructor = clusterType.getClusterClass().getConstructor(ZigBeeEndpoint.class);
    cluster = constructor.newInstance(this);
  } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException
      | IllegalArgumentException | InvocationTargetException e) {
    logger.debug("{}: Error instantiating cluster {}", getEndpointAddress(), clusterType);
    return null;
  }
  return cluster;
}

代码示例来源: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: zsmartsystems/com.zsmartsystems.zigbee

ZclClusterType.getValueById(id));
  clusterClass.setServer();
} else {
  logger.debug("{}: Setting cluster {} as client", getEndpointAddress(),
      ZclClusterType.getValueById(id));
  clusterClass.setClient();

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

@Override
public void process(ZigBeeNetworkManager networkManager, String[] args, PrintStream out)
    throws IllegalArgumentException, InterruptedException, ExecutionException {
  if (args.length != 2) {
    throw new IllegalArgumentException("Invalid number of arguments");
  }
  ZigBeeNode node = getNode(networkManager, args[1]);
  final Boolean result = node.updateBindingTable().get();
  if (!result) {
    out.println("Binding table read error");
    return;
  }
  out.println("Binding table for node " + node.getNetworkAddress() + " [" + node.getIeeeAddress() + "]");
  if (node.getBindingTable().isEmpty()) {
    out.println("--- Empty");
    return;
  }
  out.println("Src Address          | Dest Address         | Group | Mode    | Cluster");
  for (BindingTable entry : node.getBindingTable()) {
    out.println(String
        .format("%s | %20s | %5s | %-7s | %04X:%s", getAddress(entry.getSrcAddr(), entry.getSrcEndpoint()),
            entry.getDstAddrMode() == 3 ? getAddress(entry.getDstNodeAddr(), entry.getDstNodeEndpoint())
                : "",
            entry.getDstAddrMode() == 1 ? Integer.toString(entry.getDstGroupAddr()) : "",
            getAddressMode(entry.getDstAddrMode()), entry.getClusterId(),
            ZclClusterType.getValueById(entry.getClusterId())));
  }
}

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