本文整理了Java中com.zsmartsystems.zigbee.console.ZigBeeConsoleDescribeEndpointCommand
类的一些代码示例,展示了ZigBeeConsoleDescribeEndpointCommand
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZigBeeConsoleDescribeEndpointCommand
类的具体详情如下:
包路径:com.zsmartsystems.zigbee.console.ZigBeeConsoleDescribeEndpointCommand
类名称:ZigBeeConsoleDescribeEndpointCommand
暂无
代码示例来源: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
private void printClusters(final ZigBeeEndpoint endpoint, final boolean input, final PrintStream out) {
Collection<Integer> clusters;
if (input) {
clusters = endpoint.getInputClusterIds();
} else {
clusters = endpoint.getOutputClusterIds();
}
Map<Integer, ZclCluster> clusterTree = new TreeMap<Integer, ZclCluster>();
for (Integer clusterId : clusters) {
ZclCluster cluster;
if (input) {
cluster = endpoint.getInputCluster(clusterId);
} else {
cluster = endpoint.getOutputCluster(clusterId);
}
clusterTree.put(cluster.getClusterId(), cluster);
}
for (ZclCluster cluster : clusterTree.values()) {
out.println(" " + printClusterId(cluster.getClusterId()) + " " + cluster.getClusterName());
printAttributes(cluster, out);
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
private void printAttributes(final ZclCluster cluster, final PrintStream out) {
Map<Integer, ZclAttribute> attributeTree = new TreeMap<Integer, ZclAttribute>();
for (ZclAttribute attribute : cluster.getAttributes()) {
attributeTree.put(attribute.getId(), attribute);
}
for (ZclAttribute attribute : attributeTree.values()) {
out.println(String.format(" %s %5d %s%s%s %s %-40s %s %s",
(cluster.getSupportedAttributes().contains(attribute.getId()) ? "S" : "U"), attribute.getId(),
(attribute.isReadable() ? "r" : "-"), (attribute.isWritable() ? "w" : "-"),
(attribute.isReportable() ? "s" : "-"), printZclDataType(attribute.getDataType()),
attribute.getName(),
(attribute.getLastValue() == null ? "" : attribute.getLastReportTime().getTime()),
(attribute.getLastValue() == null ? "" : attribute.getLastValue())));
}
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
newCommands.put("endpoint", new ZigBeeConsoleDescribeEndpointCommand());
newCommands.put("node", new ZigBeeConsoleDescribeNodeCommand());
newCommands.put("bind", new ZigBeeConsoleBindCommand());
内容来源于网络,如有侵权,请联系作者删除!