- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.getEndpoints()
方法的一些代码示例,展示了ZigBeeNode.getEndpoints()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZigBeeNode.getEndpoints()
方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.ZigBeeNode
类名称:ZigBeeNode
方法名:getEndpoints
[英]Gets the a Collection of ZigBeeEndpoints this node provides
[中]获取此节点提供的ZigBeeEndpoints集合
代码示例来源:origin: openhab/org.openhab.binding.zigbee
public Collection<ZigBeeEndpoint> getNodeEndpoints(IeeeAddress nodeIeeeAddress) {
if (networkManager == null) {
return Collections.<ZigBeeEndpoint> emptySet();
}
ZigBeeNode node = networkManager.getNode(nodeIeeeAddress);
if (node == null) {
return Collections.<ZigBeeEndpoint> emptySet();
}
return node.getEndpoints();
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
private Map<Integer, ZigBeeEndpoint> getApplications(ZigBeeNetworkManager networkManager, int clusterId) {
Map<Integer, ZigBeeEndpoint> applications = new TreeMap<>();
for (ZigBeeNode node : networkManager.getNodes()) {
for (ZigBeeEndpoint endpoint : node.getEndpoints()) {
ZigBeeApplication application = endpoint.getApplication(clusterId);
if (application != null) {
applications.put(endpoint.getEndpointId(), endpoint);
}
}
}
return applications;
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Gets {@link ZigBeeEndpoint} by device identifier.
*
* @param networkManager the {@link ZigBeeNetworkManager}
* @param endpointId the device identifier
* @return the {@link ZigBeeEndpoint}
* @throws IllegalArgumentException
*/
protected ZigBeeEndpoint getEndpoint(final ZigBeeNetworkManager networkManager, final String endpointId)
throws IllegalArgumentException {
for (final ZigBeeNode node : networkManager.getNodes()) {
for (final ZigBeeEndpoint endpoint : node.getEndpoints()) {
if (endpointId.equals(node.getNetworkAddress() + "/" + endpoint.getEndpointId())) {
return endpoint;
}
}
}
throw new IllegalArgumentException("Endpoint '" + endpointId + "' is not found");
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void nodeAdded(ZigBeeNode node) {
for (ZigBeeEndpoint endpoint : node.getEndpoints()) {
if (endpoint.getOutputCluster(ZclOtaUpgradeCluster.CLUSTER_ID) != null) {
endpoint.addApplication(new ZclOtaUpgradeServer());
break;
}
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Gets device by device identifier.
*
* @param zigbeeApi the ZigBee API
* @param deviceIdentifier the device identifier
* @return the device
*/
private ZigBeeEndpoint getDevice(ZigBeeApi zigbeeApi, final String deviceIdentifier) {
for (final ZigBeeNode node : networkManager.getNodes()) {
for (final ZigBeeEndpoint endpoint : node.getEndpoints()) {
if (deviceIdentifier.equals(node.getNetworkAddress() + "/" + endpoint.getEndpointId())) {
return endpoint;
}
}
}
return null;
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
/**
* Starts service discovery for the node.
*/
public void startDiscovery() {
logger.debug("{}: Node SVC Discovery: start discovery", node.getIeeeAddress());
Set<NodeDiscoveryTask> tasks = new HashSet<NodeDiscoveryTask>();
// Always request the network address - in case it's changed
tasks.add(NodeDiscoveryTask.NWK_ADDRESS);
if (node.getNodeDescriptor().getLogicalType() == LogicalType.UNKNOWN) {
tasks.add(NodeDiscoveryTask.NODE_DESCRIPTOR);
}
if (node.getPowerDescriptor().getCurrentPowerMode() == CurrentPowerModeType.UNKNOWN) {
tasks.add(NodeDiscoveryTask.POWER_DESCRIPTOR);
}
if (node.getEndpoints().size() == 0 && node.getNetworkAddress() != networkManager.getLocalNwkAddress()) {
tasks.add(NodeDiscoveryTask.ACTIVE_ENDPOINTS);
}
tasks.add(NodeDiscoveryTask.NEIGHBORS);
startDiscovery(tasks);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
for (final ZigBeeEndpoint endpoint : node.getEndpoints()) {
endpointIds.add(endpoint.getEndpointId());
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
node.getIeeeAddress(), node.getLogicalType()));
List<Integer> endpointIds = new ArrayList<Integer>();
for (final ZigBeeEndpoint endpoint : node.getEndpoints()) {
endpointIds.add(endpoint.getEndpointId());
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public void nodeAdded(ZigBeeNode node) {
for (ZigBeeEndpoint endpoint : node.getEndpoints()) {
if (endpoint.getInputCluster(ZclIasZoneCluster.CLUSTER_ID) != null) {
endpoint.addApplication(new ZclIasZoneClient(networkManager.getNode(0).getIeeeAddress(), 0));
break;
}
}
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
Collection<ZigBeeEndpoint> endpoints = node.getEndpoints();
for (ZigBeeEndpoint endpoint : node.getEndpoints()) {
otaCluster = (ZclOtaUpgradeCluster) endpoint.getOutputCluster(ZclOtaUpgradeCluster.CLUSTER_ID);
if (otaCluster != null) {
代码示例来源:origin: openhab/org.openhab.binding.zigbee
for (ZigBeeEndpoint endpoint : node.getEndpoints()) {
otaServer = (ZclOtaUpgradeServer) endpoint.getApplication(ZclOtaUpgradeCluster.CLUSTER_ID);
if (otaServer != null) {
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void isDiscovered() {
ZigBeeNode node = new ZigBeeNode(Mockito.mock(ZigBeeNetworkManager.class), new IeeeAddress("1234567890"));
ZigBeeNetworkEndpointListener listener = Mockito.mock(ZigBeeNetworkEndpointListener.class);
node.addNetworkEndpointListener(listener);
assertFalse(node.isDiscovered());
assertNotNull(node.getEndpoints());
NodeDescriptor descriptor = new NodeDescriptor(0, 3333, 74, true, 6666, 0, 6, 4444, true, 8);
node.setNodeDescriptor(descriptor);
assertFalse(node.isDiscovered());
ZigBeeEndpoint endpoint = new ZigBeeEndpoint(node, 1);
node.addEndpoint(endpoint);
assertTrue(node.isDiscovered());
Mockito.verify(listener, Mockito.timeout(TIMEOUT)).deviceAdded(endpoint);
assertEquals(endpoint, node.getEndpoint(1));
assertEquals(1, node.getEndpoints().size());
node.removeEndpoint(1);
assertEquals(0, node.getEndpoints().size());
Mockito.verify(listener, Mockito.timeout(TIMEOUT)).deviceRemoved(endpoint);
node.removeNetworkEndpointListener(listener);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void testNormal() {
// Add all the required responses to a list
IeeeAddressResponse ieeeResponse = new IeeeAddressResponse();
ieeeResponse.setStatus(ZdoStatus.SUCCESS);
ieeeResponse.setSourceAddress(new ZigBeeEndpointAddress(0));
ieeeResponse.setDestinationAddress(new ZigBeeEndpointAddress(0));
ieeeResponse.setIeeeAddrRemoteDev(new IeeeAddress("1234567890ABCDEF"));
responses.put(ZdoCommandType.IEEE_ADDRESS_REQUEST.getClusterId(), ieeeResponse);
ZigBeeNetworkDiscoverer discoverer = new ZigBeeNetworkDiscoverer(networkManager);
discoverer.setRetryPeriod(1);
discoverer.startup();
// Check it registers listeners
Mockito.verify(networkManager).addCommandListener(discoverer);
Mockito.verify(networkManager).addAnnounceListener(discoverer);
// Then wait for the node to be added
Mockito.verify(networkManager, Mockito.timeout(TIMEOUT).times(1)).addNode(nodeCapture.capture());
ZigBeeNode node = nodeCapture.getValue();
assertNotNull(node);
assertEquals(Integer.valueOf(0), node.getNetworkAddress());
assertEquals(new IeeeAddress("1234567890ABCDEF"), node.getIeeeAddress());
assertEquals(0, node.getEndpoints().size());
}
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.getNodeState()方法的一些代码示例,展示了ZigBeeNode.getNodeState()的具
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.isDiscovered()方法的一些代码示例,展示了ZigBeeNode.isDiscovered()的具
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.setNodeState()方法的一些代码示例,展示了ZigBeeNode.setNodeState()的具
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.setAssociatedDevices()方法的一些代码示例,展示了ZigBeeNode.setAssoc
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.setNodeDescriptor()方法的一些代码示例,展示了ZigBeeNode.setNodeDesc
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.getRoutes()方法的一些代码示例,展示了ZigBeeNode.getRoutes()的具体用法。这些
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.setNetworkAddress()方法的一些代码示例,展示了ZigBeeNode.setNetworkA
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.setPowerDescriptor()方法的一些代码示例,展示了ZigBeeNode.setPowerDe
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.getLastUpdateTime()方法的一些代码示例,展示了ZigBeeNode.getLastUpda
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.getLogicalType()方法的一些代码示例,展示了ZigBeeNode.getLogicalType
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.getPowerDescriptor()方法的一些代码示例,展示了ZigBeeNode.getPowerDe
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.addEndpoint()方法的一些代码示例,展示了ZigBeeNode.addEndpoint()的具体用
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.setNeighbors()方法的一些代码示例,展示了ZigBeeNode.setNeighbors()的具
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.getBindingTable()方法的一些代码示例,展示了ZigBeeNode.getBindingTab
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.getNodeDescriptor()方法的一些代码示例,展示了ZigBeeNode.getNodeDesc
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.permitJoin()方法的一些代码示例,展示了ZigBeeNode.permitJoin()的具体用法。
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.setRoutes()方法的一些代码示例,展示了ZigBeeNode.setRoutes()的具体用法。这些
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.getNeighbors()方法的一些代码示例,展示了ZigBeeNode.getNeighbors()的具
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.getEndpoint()方法的一些代码示例,展示了ZigBeeNode.getEndpoint()的具体用
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.getNetworkAddress()方法的一些代码示例,展示了ZigBeeNode.getNetworkA
我是一名优秀的程序员,十分优秀!