gpt4 book ai didi

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

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

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

ZigBeeEndpoint.getParentNode介绍

[英]Gets the parent ZigBeeNode in which this endpoint is situated
[中]获取此终结点所在的父节点

代码示例

代码示例来源: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

@Override
public void process(ZigBeeNetworkManager networkManager, String[] args, PrintStream out)
    throws IllegalArgumentException {
  if (args.length != 2) {
    throw new IllegalArgumentException("Invalid number of arguments");
  }
  final ZigBeeEndpoint endpoint = getEndpoint(networkManager, args[1]);
  ZigBeeProfileType profile = ZigBeeProfileType.getByValue(endpoint.getProfileId());
  ZigBeeDeviceType device = ZigBeeDeviceType.getByValue(endpoint.getDeviceId());
  out.println("IEEE Address     : " + endpoint.getIeeeAddress());
  out.println("Network Address  : " + endpoint.getParentNode().getNetworkAddress());
  out.println("Endpoint         : " + endpoint.getEndpointId());
  out.println("Device Profile   : " + String.format("0x%04X, ", endpoint.getProfileId())
      + (profile == null ? "Unknown" : profile.toString()));
  out.println("Device Type      : " + String.format("0x%04X, ", endpoint.getDeviceId())
      + (device == null ? "Unknown" : device.toString()));
  out.println("Device Version   : " + endpoint.getDeviceVersion());
  out.println("Input Clusters   : (Server)");
  printClusters(endpoint, true, out);
  out.println("Output Clusters  : (Client)");
  printClusters(endpoint, false, out);
}

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

assertEquals(node, endpoint.getParentNode());

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