gpt4 book ai didi

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

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

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

ZigBeeEndpoint.getApplication介绍

[英]Gets the application associated with the clusterId. Returns null if there is no server linked to the requested cluster
[中]获取与群集ID关联的应用程序。如果没有服务器链接到请求的群集,则返回null

代码示例

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

private void cmdDisplayAllNodes(ZigBeeNetworkManager networkManager, PrintStream out) {
  Map<Integer, ZigBeeEndpoint> applications = getApplications(networkManager, ZclOtaUpgradeCluster.CLUSTER_ID);
  if (applications.isEmpty()) {
    out.println("No OTA upgrade servers found.");
    return;
  }
  out.println("Address    Ieee Address      State     ");
  for (ZigBeeEndpoint endpoint : applications.values()) {
    ZclOtaUpgradeServer otaServer = (ZclOtaUpgradeServer) endpoint
        .getApplication(ZclOtaUpgradeCluster.CLUSTER_ID);
    out.println(String.format("%-9s  %s  %-8s", endpoint.getEndpointAddress(), endpoint.getIeeeAddress(),
        otaServer.getServerStatus()));
  }
}

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

private Map<Integer, ZigBeeEndpoint> getApplications(ZigBeeNetworkManager networkManager, int clusterId) {
    Map<Integer, ZigBeeEndpoint> applications = new TreeMap<>();

    for (ZigBeeNode node : networkManager.getNodes()) {
      for (ZigBeeEndpoint endpoint : node.getEndpoints()) {
        ZigBeeApplication application = endpoint.getApplication(clusterId);
        if (application != null) {
          applications.put(endpoint.getEndpointId(), endpoint);
        }
      }
    }

    return applications;
  }
}

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

@Override
public void process(ZigBeeNetworkManager networkManager, String[] args, PrintStream out)
    throws IllegalArgumentException {
  if (args.length == 1) {
    cmdDisplayAllNodes(networkManager, out);
    return;
  }
  Map<Integer, ZigBeeEndpoint> applications = getApplications(networkManager, ZclOtaUpgradeCluster.CLUSTER_ID);
  ZigBeeNode node = getNode(networkManager, args[1]);
  ZigBeeEndpoint endpoint = null;
  ZclOtaUpgradeServer server = null;
  for (ZigBeeEndpoint applicationEndpoint : applications.values()) {
    if (applicationEndpoint.getParentNode().equals(node)) {
      endpoint = applicationEndpoint;
      server = (ZclOtaUpgradeServer) endpoint.getApplication(ZclOtaUpgradeCluster.CLUSTER_ID);
    }
  }
  if (server == null) {
    throw new IllegalArgumentException(
        "Node " + node.getNetworkAddress().toString() + " does not implement the OTA Upgrade server");
  }
  if (args.length == 2) {
    cmdDisplayNode(endpoint, server, out);
    return;
  }
  throw new IllegalArgumentException("Invalid number of arguments");
}

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

.getApplication(ZclOtaUpgradeCluster.CLUSTER_ID);
if (otaServer == null) {

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

ZigBeeEndpoint otaEndpoint = null;
for (ZigBeeEndpoint endpoint : node.getEndpoints()) {
  otaServer = (ZclOtaUpgradeServer) endpoint.getApplication(ZclOtaUpgradeCluster.CLUSTER_ID);
  if (otaServer != null) {
    break;

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