gpt4 book ai didi

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

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

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

ZigBeeNetworkManager.leave介绍

[英]Sends a ZDO Leave Request to a device requesting that an end device leave the network.
[中]向设备发送ZDO离开请求,请求终端设备离开网络。

代码示例

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

@Override
  public void process(ZigBeeNetworkManager networkManager, String[] args, PrintStream out)
      throws IllegalArgumentException {
    if (args.length > 3) {
      throw new IllegalArgumentException("Invalid number of arguments");
    }

    ZigBeeNode leaver = getNode(networkManager, args[1]);

    if (args.length == 2) {
      networkManager.leave(leaver.getNetworkAddress(), leaver.getIeeeAddress());
      return;
    }

    if (args.length == 3) {
      ZigBeeNode parent = getNode(networkManager, args[2]);
      networkManager.leave(parent.getNetworkAddress(), leaver.getIeeeAddress());
      return;
    }
  }
}

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

/**
 * Sends a ZDO Leave Request to a device requesting that an end device leave the network.
 * <p>
 * This method will send the ZDO message to the device itself requesting it leave the network
 *
 * @param address the network address to leave
 * @return true if the command is sent
 */
public boolean leave(IeeeAddress address) {
  // First we want to make sure that join is disabled
  networkManager.permitJoin(0);
  logger.debug("{}: ZigBee leave command", address);
  ZigBeeNode node = networkManager.getNode(address);
  if (node == null) {
    logger.debug("{}: ZigBee leave command - node not found", address);
    return false;
  }
  logger.debug("{}: ZigBee leave command to {}", address, node.getNetworkAddress());
  networkManager.leave(node.getNetworkAddress(), node.getIeeeAddress());
  return true;
}

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