com.zsmartsystems.zigbee.console.ZigBeeConsoleAttributeSupportedCommand类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(59)

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

ZigBeeConsoleAttributeSupportedCommand介绍

暂无

代码示例

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

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

    final ZigBeeEndpoint endpoint = getEndpoint(networkManager, args[1]);
    ZclCluster cluster = getCluster(endpoint, args[2]);

    final Future<Boolean> future = cluster.discoverAttributes(false);
    Boolean result = future.get();
    if (result) {
      out.println("Supported attributes for " + printCluster(cluster));
      out.println("AttrId  Data Type                  Name");
      for (Integer attributeId : cluster.getSupportedAttributes()) {
        out.print(" ");
        ZclAttribute attribute = cluster.getAttribute(attributeId);
        out.print(printAttributeId(attributeId));
        if (attribute != null) {
          out.print("  " + printZclDataType(attribute.getDataType()) + "  " + attribute.getName());
        }
        out.println();
      }
    } else {
      out.println("Failed to retrieve supported attributes");
    }
  }
}

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

newCommands.put("write", new ZigBeeConsoleAttributeWriteCommand());
newCommands.put("attsupported", new ZigBeeConsoleAttributeSupportedCommand());
newCommands.put("cmdsupported", new ZigBeeConsoleCommandsSupportedCommand());

相关文章