- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeEndpoint
类的一些代码示例,展示了ZigBeeEndpoint
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZigBeeEndpoint
类的具体详情如下:
包路径:com.zsmartsystems.zigbee.ZigBeeEndpoint
类名称:ZigBeeEndpoint
[英]ZigBee endpoint. An endpoint is a virtual entity contained within a ZigBeeNode. The ZigBeeNode is the physical device and can contain up to 254 endpoints.
[中]ZigBee端点。端点是包含在节点中的虚拟实体。ZigBeeNode是物理设备,最多可包含254个端点。
代码示例来源: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: openhab/org.openhab.binding.zigbee
public List<ZclClusterConfigHandler> getConfigHandlers(ZigBeeEndpoint endpoint) {
List<ZclClusterConfigHandler> handlers = new ArrayList<>();
for (int clusterId : endpoint.getInputClusterIds()) {
try {
ZclClusterConfigHandler handler = getClusterConfigHandler(endpoint.getInputCluster(clusterId));
if (handler != null) {
handlers.add(handler);
}
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException | NoSuchMethodException | SecurityException e) {
logger.debug("{}: Exception while getting config for input cluster {}: ", endpoint.getIeeeAddress(),
clusterId, e);
}
}
for (int clusterId : endpoint.getOutputClusterIds()) {
try {
ZclClusterConfigHandler handler = getClusterConfigHandler(endpoint.getOutputCluster(clusterId));
if (handler != null) {
handlers.add(handler);
}
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException | NoSuchMethodException | SecurityException e) {
logger.debug("{}: Exception while getting config for output cluster {}: ", endpoint.getIeeeAddress(),
clusterId, e);
}
}
return handlers;
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public String toString() {
return "ZigBeeEndpoint [networkAddress=" + getEndpointAddress().toString() + ", profileId="
+ String.format("%04X", profileId) + ", deviceId=" + deviceId + ", deviceVersion=" + deviceVersion
+ ", inputClusterIds=" + getInputClusterIds().toString() + ", outputClusterIds="
+ getOutputClusterIds().toString() + "]";
}
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
protected boolean hasIasZoneInputCluster(ZigBeeEndpoint endpoint) {
if (endpoint.getInputCluster(ZclIasZoneCluster.CLUSTER_ID) == null) {
logger.trace("{}: IAS zone cluster not found", endpoint.getIeeeAddress());
return false;
}
return true;
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Gets a cluster from the input or output cluster list depending on the command {@link ZclCommandDirection} for a
* received command.
* <p>
* If commandDirection is {@link ZclCommandDirection#CLIENT_TO_SERVER} then the cluster comes from the output
* cluster list.
* If commandDirection is {@link ZclCommandDirection#SERVER_TO_CLIENT} then the cluster comes from the input
* cluster list.
*
* @param clusterId the cluster ID to get
* @param direction the {@link ZclCommandDirection}
* @return the {@link ZclCluster} or null if the cluster is not known
*/
private ZclCluster getReceiveCluster(int clusterId, ZclCommandDirection direction) {
if (direction == ZclCommandDirection.CLIENT_TO_SERVER) {
return getOutputCluster(clusterId);
} else {
return getInputCluster(clusterId);
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Sets input cluster IDs. This will add any new clusters in the list, and remove any that are no longer in the
* list.
*
* @param inputClusterIds the input cluster IDs
*/
public void setInputClusterIds(List<Integer> inputClusterIds) {
inputClusters.clear();
logger.debug("{}: Setting input clusters {}", getEndpointAddress(), inputClusterIds);
updateClusters(inputClusters, inputClusterIds, true);
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
logger.debug("{}: Checking endpoint {} channels", nodeIeeeAddress, endpoint.getEndpointId());
nodeChannels.addAll(channelFactory.getChannels(getThing().getUID(), endpoint));
endpoint = new ZigBeeEndpoint(node, endpointId);
endpoint.setProfileId(profileId);
node.addEndpoint(endpoint);
staticClusters = processClusterList(endpoint.getInputClusterIds(),
properties.get(ZigBeeBindingConstants.CHANNEL_PROPERTY_INPUTCLUSTERS));
if (!staticClusters.isEmpty()) {
logger.debug("{}: Forcing endpoint {} input clusters {}", nodeIeeeAddress, endpointId, staticClusters);
endpoint.setInputClusterIds(staticClusters);
modified = true;
staticClusters = processClusterList(endpoint.getOutputClusterIds(),
properties.get(ZigBeeBindingConstants.CHANNEL_PROPERTY_OUTPUTCLUSTERS));
if (!staticClusters.isEmpty()) {
logger.debug("{}: Forcing endpoint {} output clusters {}", nodeIeeeAddress, endpointId, staticClusters);
endpoint.setOutputClusterIds(staticClusters);
modified = true;
代码示例来源:origin: openhab/org.openhab.binding.zigbee
@Override
public boolean initializeConverter() {
clusterOnOffClient = (ZclOnOffCluster) endpoint.getOutputCluster(ZclOnOffCluster.CLUSTER_ID);
clusterOnOffServer = (ZclOnOffCluster) endpoint.getInputCluster(ZclOnOffCluster.CLUSTER_ID);
if (clusterOnOffClient == null && clusterOnOffServer == null) {
logger.error("{}: Error opening device on/off controls", endpoint.getIeeeAddress());
return false;
}
if (clusterOnOffServer != null) {
// Add the listener
clusterOnOffServer.addAttributeListener(this);
}
if (clusterOnOffClient != null) {
// Add the command listener
clusterOnOffClient.addCommandListener(this);
}
return true;
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Adds a binding from the cluster to the destination {@link ZigBeeEndpoint}.
*
* @param address the destination {@link IeeeAddress}
* @param endpointId the destination endpoint ID
* @return Command future
*/
public Future<CommandResult> bind(IeeeAddress address, int endpointId) {
final BindRequest command = new BindRequest();
command.setDestinationAddress(new ZigBeeEndpointAddress(zigbeeEndpoint.getEndpointAddress().getAddress()));
command.setSrcAddress(zigbeeEndpoint.getIeeeAddress());
command.setSrcEndpoint(zigbeeEndpoint.getEndpointId());
command.setBindCluster(clusterId);
command.setDstAddrMode(3); // 64 bit addressing
command.setDstAddress(address);
command.setDstEndpoint(endpointId);
return zigbeeEndpoint.sendTransaction(command, new BindRequest());
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void testInputClusterIds() {
ZigBeeEndpoint endpoint = getEndpoint();
List<Integer> clusterIdList = new ArrayList<Integer>();
clusterIdList.add(ZclAlarmsCluster.CLUSTER_ID);
clusterIdList.add(ZclBasicCluster.CLUSTER_ID);
clusterIdList.add(ZclColorControlCluster.CLUSTER_ID);
clusterIdList.add(ZclDoorLockCluster.CLUSTER_ID);
clusterIdList.add(ZclLevelControlCluster.CLUSTER_ID);
endpoint.setInputClusterIds(clusterIdList);
assertEquals(5, endpoint.getInputClusterIds().size());
assertNotNull(endpoint.getInputCluster(ZclAlarmsCluster.CLUSTER_ID));
assertFalse(endpoint.getInputCluster(ZclAlarmsCluster.CLUSTER_ID).isClient());
assertTrue(endpoint.getInputCluster(ZclAlarmsCluster.CLUSTER_ID).isServer());
assertNotNull(endpoint.getInputCluster(ZclLevelControlCluster.CLUSTER_ID));
assertFalse(endpoint.getInputCluster(ZclLevelControlCluster.CLUSTER_ID).isClient());
assertTrue(endpoint.getInputCluster(ZclLevelControlCluster.CLUSTER_ID).isServer());
assertTrue(endpoint.addInputCluster(new ZclScenesCluster(endpoint)));
assertFalse(endpoint.addInputCluster(new ZclScenesCluster(endpoint)));
assertTrue(endpoint.getInputClusterIds().contains(ZclScenesCluster.CLUSTER_ID));
assertTrue(endpoint.getOutputClusterIds().isEmpty());
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void testOutputClusterIds() {
ZigBeeEndpoint endpoint = getEndpoint();
List<Integer> clusterIdList = new ArrayList<Integer>();
clusterIdList.add(ZclAlarmsCluster.CLUSTER_ID);
clusterIdList.add(ZclBasicCluster.CLUSTER_ID);
clusterIdList.add(ZclColorControlCluster.CLUSTER_ID);
clusterIdList.add(ZclDoorLockCluster.CLUSTER_ID);
clusterIdList.add(ZclLevelControlCluster.CLUSTER_ID);
endpoint.setOutputClusterIds(clusterIdList);
assertEquals(5, endpoint.getOutputClusterIds().size());
assertNotNull(endpoint.getOutputCluster(ZclAlarmsCluster.CLUSTER_ID));
assertTrue(endpoint.getOutputCluster(ZclAlarmsCluster.CLUSTER_ID).isClient());
assertFalse(endpoint.getOutputCluster(ZclAlarmsCluster.CLUSTER_ID).isServer());
assertNotNull(endpoint.getOutputCluster(ZclLevelControlCluster.CLUSTER_ID));
assertTrue(endpoint.getOutputCluster(ZclLevelControlCluster.CLUSTER_ID).isClient());
assertFalse(endpoint.getOutputCluster(ZclLevelControlCluster.CLUSTER_ID).isServer());
clusterIdList = new ArrayList<Integer>();
clusterIdList.add(ZclAlarmsCluster.CLUSTER_ID);
clusterIdList.add(ZclBasicCluster.CLUSTER_ID);
assertTrue(endpoint.getOutputCluster(ZclAlarmsCluster.CLUSTER_ID).isClient());
assertFalse(endpoint.getOutputCluster(ZclLevelControlCluster.CLUSTER_ID).isServer());
assertTrue(endpoint.addOutputCluster(new ZclScenesCluster(endpoint)));
assertFalse(endpoint.addOutputCluster(new ZclScenesCluster(endpoint)));
assertTrue(endpoint.getOutputClusterIds().contains(ZclScenesCluster.CLUSTER_ID));
assertTrue(endpoint.getInputClusterIds().isEmpty());
System.out.println(endpoint.toString());
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
@Override
public Channel getChannel(ThingUID thingUID, ZigBeeEndpoint endpoint) {
ZclPowerConfigurationCluster powerConfigurationCluster = (ZclPowerConfigurationCluster) endpoint
.getInputCluster(ZclPowerConfigurationCluster.CLUSTER_ID);
if (powerConfigurationCluster == null) {
logger.trace("{}: Power configuration cluster not found on endpoint {}", endpoint.getIeeeAddress(),
endpoint.getEndpointId());
return null;
}
try {
if (!powerConfigurationCluster.discoverAttributes(false).get() && !powerConfigurationCluster
.isAttributeSupported(ZclPowerConfigurationCluster.ATTR_BATTERYALARMSTATE)) {
logger.trace("{}: Power configuration cluster battery alarm state not supported",
endpoint.getIeeeAddress());
return null;
}
} catch (InterruptedException | ExecutionException e) {
logger.warn("{}: Exception discovering attributes in power configuration cluster",
endpoint.getIeeeAddress(), e);
return null;
}
return ChannelBuilder
.create(createChannelUID(thingUID, endpoint, ZigBeeBindingConstants.CHANNEL_NAME_POWER_BATTERYALARM),
ZigBeeBindingConstants.ITEM_TYPE_STRING)
.withType(ZigBeeBindingConstants.CHANNEL_POWER_BATTERYALARM)
.withLabel(ZigBeeBindingConstants.CHANNEL_LABEL_POWER_BATTERYALARM)
.withProperties(createProperties(endpoint)).build();
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
ZigBeeEndpoint endpoint = new ZigBeeEndpoint(node, endpointId);
SimpleDescriptor simpleDescriptor = simpleDescriptorResponse.getSimpleDescriptor();
endpoint.setProfileId(simpleDescriptor.getProfileId());
endpoint.setDeviceId(simpleDescriptor.getDeviceId());
endpoint.setDeviceVersion(simpleDescriptor.getDeviceVersion());
endpoint.setInputClusterIds(simpleDescriptor.getInputClusterList());
endpoint.setOutputClusterIds(simpleDescriptor.getOutputClusterList());
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
result = endpoint.getInputCluster(clusterId);
} else if (isOutput) {
result = endpoint.getOutputCluster(clusterId);
} else {
ZclCluster cluster = endpoint.getInputCluster(clusterId);
result = (cluster != null) ? cluster : endpoint.getOutputCluster(clusterId);
} else {
throw new IllegalArgumentException("A cluster specified by " + clusterSpecifier
+ " is not found for endpoint " + endpoint.getEndpointId());
代码示例来源:origin: openhab/org.openhab.binding.zigbee
/**
* Creates a standard channel UID given the {@link ZigBeeEndpoint}
*
* @param thingUID the {@link ThingUID}
* @param endpoint the {@link ZigBeeEndpoint}
* @param channelName the name of the channel
* @return
*/
protected ChannelUID createChannelUID(ThingUID thingUID, ZigBeeEndpoint endpoint, String channelName) {
return new ChannelUID(thingUID, endpoint.getIeeeAddress() + "_" + endpoint.getEndpointId() + "_" + channelName);
}
代码示例来源: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
/**
* Returns the ZigBee address of this cluster
*
* @return the {@link ZigBeeEndpointAddress} of the cluster
*/
public ZigBeeEndpointAddress getZigBeeAddress() {
return zigbeeEndpoint.getEndpointAddress();
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
endpoint.getIeeeAddress(), channel.getUID());
return false;
ZclCluster clientCluster = endpoint.getOutputCluster(clusterId);
if (clientCluster == null) {
logger.error("{}: Error opening client cluster {} on endpoint {}", endpoint.getIeeeAddress(), clusterId,
endpoint.getEndpointId());
return false;
CommandResult bindResponse = bind(clientCluster).get();
if (!bindResponse.isSuccess()) {
logger.error("{}: Error 0x{} setting client binding for cluster {}", endpoint.getIeeeAddress(),
toHexString(bindResponse.getStatusCode()), clusterId);
logger.error(endpoint.getIeeeAddress() + ": Exception setting binding to cluster " + clusterId, e);
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
private void cmdDisplayAllNodes(ZigBeeNetworkManager networkManager, PrintStream out) {
Map<Integer, ZigBeeEndpoint> applications = getApplications(networkManager, ZclOtaUpgradeCluster.CLUSTER_ID);
if (applications.isEmpty()) {
out.println("No OTA upgrade servers found.");
return;
}
out.println("Address Ieee Address State ");
for (ZigBeeEndpoint endpoint : applications.values()) {
ZclOtaUpgradeServer otaServer = (ZclOtaUpgradeServer) endpoint
.getApplication(ZclOtaUpgradeCluster.CLUSTER_ID);
out.println(String.format("%-9s %s %-8s", endpoint.getEndpointAddress(), endpoint.getIeeeAddress(),
otaServer.getServerStatus()));
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
private void createEndpoint() {
endpoint = Mockito.mock(ZigBeeEndpoint.class);
Mockito.when(endpoint.getEndpointId()).thenReturn(5);
Mockito.when(endpoint.getEndpointAddress()).thenReturn(new ZigBeeEndpointAddress(1234, 5));
commandCapture = ArgumentCaptor.forClass(ZigBeeCommand.class);
matcherCapture = ArgumentCaptor.forClass(ZigBeeTransactionMatcher.class);
Mockito.when(endpoint.sendTransaction(commandCapture.capture(), matcherCapture.capture())).thenReturn(null);
}
Zigbee 和 Zigbee PRO 之间有什么区别(如果有)? 我在维基百科和 official Zigbee site 上找不到任何具体内容这一切都归结为一些优化。 实际使用上有什么区别吗? 最
是否可以使用 XBee PRO S2B 与 ZigBee HA(家庭自动化)配置文件传感器进行通信?如果可以,如何进行通信?有谁知道我在哪里可以找到有关 ZigBee HA 配置文件的规范? 非常感谢
我已经有一段时间不了解 ZigBee 了。谁拥有最成熟的 Zigbee 堆栈?是 Microchip、Chipcon 还是 Atmel? 是否有价格低于 10 美元的 RF 模块? 我记得不久前某些堆
我之前的经验是能够接收我的温度/湿度zigbee传感器发送的数据。此外,我还可以发送命令来控制 zigbee 功率计/开关。 我购买了一个运动检测传感器,其中包含一行 IAS 数据包的文档。我知道这是
我之前的经验是能够接收我的温度/湿度zigbee传感器发送的数据。此外,我还可以发送命令来控制 zigbee 功率计/开关。 我购买了一个运动检测传感器,其中包含一行 IAS 数据包的文档。我知道这是
我目前正在研究 ZigBee,我遇到了以下问题: 每个 ZigBee 设备都有一个 16 位短地址,这意味着我最多可以连接 2^16=65536 个不同的设备(当然减去一些保留地址)。现在每个设备最多
关于这个问题,我询问了一些从事ZigBee应用开发的开发人员。他们告诉我,一个 radio 模块(对我来说,这是指一个节点,同一件事)在形成网络时只能有一个配置文件。 但是,当我阅读“Drew Gis
智能家居连接,不仅仅只有 Wi-Fi 和蓝牙这些大家熟悉的技术,还有一些更加符合智能家居应用的行业专有协议,比如Zigbee,Z-Wave 和 Thread等等。 当谈到家庭自动化时
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeApsFrame类的一些代码示例,展示了ZigBeeApsFrame类的具体用法。这些代码示例主要来源于Github/
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeEndpointAddress类的一些代码示例,展示了ZigBeeEndpointAddress类的具体用法。这些代码
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeChannel类的一些代码示例,展示了ZigBeeChannel类的具体用法。这些代码示例主要来源于Github/St
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNetworkManager类的一些代码示例,展示了ZigBeeNetworkManager类的具体用法。这些代码示例
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeEndpoint类的一些代码示例,展示了ZigBeeEndpoint类的具体用法。这些代码示例主要来源于Github/
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode类的一些代码示例,展示了ZigBeeNode类的具体用法。这些代码示例主要来源于Github/Stackove
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeProfileType类的一些代码示例,展示了ZigBeeProfileType类的具体用法。这些代码示例主要来源于G
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeAddress类的一些代码示例,展示了ZigBeeAddress类的具体用法。这些代码示例主要来源于Github/St
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeGroupAddress类的一些代码示例,展示了ZigBeeGroupAddress类的具体用法。这些代码示例主要来源
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeCommand类的一些代码示例,展示了ZigBeeCommand类的具体用法。这些代码示例主要来源于Github/St
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNetworkNodeListener类的一些代码示例,展示了ZigBeeNetworkNodeListener类的具
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeBroadcastDestination类的一些代码示例,展示了ZigBeeBroadcastDestination类
我是一名优秀的程序员,十分优秀!