本文整理了Java中com.zsmartsystems.zigbee.zcl.protocol.ZclClusterType
类的一些代码示例,展示了ZclClusterType
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZclClusterType
类的具体详情如下:
包路径:com.zsmartsystems.zigbee.zcl.protocol.ZclClusterType
类名称:ZclClusterType
[英]Enumeration of ZigBee Clusters
Code is auto-generated. Modifications may be overwritten!
[中]ZigBee集群的计数
代码是自动生成的。修改可能会被覆盖!
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public String toString() {
Integer resolvedClusterId = getClusterId();
final StringBuilder builder = new StringBuilder();
builder.append(ZclClusterType.getValueById(resolvedClusterId).getLabel());
builder.append(": ");
builder.append(super.toString());
return builder.toString();
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
private ZclCluster getClusterClass(int clusterId) {
ZclClusterType clusterType = ZclClusterType.getValueById(clusterId);
if (clusterType == null) {
// Unsupported cluster
logger.debug("{}: Unsupported cluster {}", getEndpointAddress(), clusterId);
return null;
}
// Create a cluster class
ZclCluster cluster = null;
Constructor<? extends ZclCluster> constructor;
try {
constructor = clusterType.getClusterClass().getConstructor(ZigBeeEndpoint.class);
cluster = constructor.newInstance(this);
} catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException e) {
logger.debug("{}: Error instantiating cluster {}", getEndpointAddress(), clusterType);
return null;
}
return cluster;
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Adds a cluster to the list of clusters we will match
*
* @param cluster the cluster to match
*/
public void addCluster(int cluster) {
logger.debug("ClusterMatcher adding cluster {}", ZclClusterType.getValueById(cluster));
clusters.add(cluster);
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
if (attribute.getCluster().getId() == ZclOnOffCluster.CLUSTER_ID) {
if (attribute.getId() == ZclOnOffCluster.ATTR_ONOFF) {
Boolean value = (Boolean) attribute.getLastValue();
updateOnOff(onoff);
} else if (attribute.getCluster().getId() == ZclLevelControlCluster.CLUSTER_ID) {
if (attribute.getId() == ZclLevelControlCluster.ATTR_CURRENTLEVEL) {
PercentType brightness = levelToPercent((Integer) attribute.getLastValue());
updateBrightness(brightness);
} else if (attribute.getCluster().getId() == ZclColorControlCluster.CLUSTER_ID) {
if (attribute.getId() == ZclColorControlCluster.ATTR_CURRENTHUE) {
Integer value = (Integer) attribute.getLastValue();
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
private void outputEndpoint(PrintStream out, ZigBeeEndpoint endpoint) {
out.println("Profile " + String.format("%04X ", endpoint.getProfileId())
+ ZigBeeProfileType.getByValue(endpoint.getProfileId()));
out.println(" : Device Type " + String.format("%04X ", endpoint.getDeviceId())
+ com.zsmartsystems.zigbee.ZigBeeDeviceType.getByValue(endpoint.getDeviceId()).toString());
for (Integer clusterId : endpoint.getInputClusterIds()) {
out.println(" -> " + ZclClusterType.getValueById(clusterId));
}
for (Integer clusterId : endpoint.getOutputClusterIds()) {
out.println(" <- " + ZclClusterType.getValueById(clusterId));
}
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
ZclClusterType.getValueById(id));
clusterClass.setServer();
} else {
logger.debug("{}: Setting cluster {} as client", getEndpointAddress(),
ZclClusterType.getValueById(id));
clusterClass.setClient();
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void process(ZigBeeNetworkManager networkManager, String[] args, PrintStream out)
throws IllegalArgumentException, InterruptedException, ExecutionException {
if (args.length != 2) {
throw new IllegalArgumentException("Invalid number of arguments");
}
ZigBeeNode node = getNode(networkManager, args[1]);
final Boolean result = node.updateBindingTable().get();
if (!result) {
out.println("Binding table read error");
return;
}
out.println("Binding table for node " + node.getNetworkAddress() + " [" + node.getIeeeAddress() + "]");
if (node.getBindingTable().isEmpty()) {
out.println("--- Empty");
return;
}
out.println("Src Address | Dest Address | Group | Mode | Cluster");
for (BindingTable entry : node.getBindingTable()) {
out.println(String
.format("%s | %20s | %5s | %-7s | %04X:%s", getAddress(entry.getSrcAddr(), entry.getSrcEndpoint()),
entry.getDstAddrMode() == 3 ? getAddress(entry.getDstNodeAddr(), entry.getDstNodeEndpoint())
: "",
entry.getDstAddrMode() == 1 ? Integer.toString(entry.getDstGroupAddr()) : "",
getAddressMode(entry.getDstAddrMode()), entry.getClusterId(),
ZclClusterType.getValueById(entry.getClusterId())));
}
}
内容来源于网络,如有侵权,请联系作者删除!