本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.addEndpoint()
方法的一些代码示例,展示了ZigBeeNode.addEndpoint()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZigBeeNode.addEndpoint()
方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.ZigBeeNode
类名称:ZigBeeNode
方法名:addEndpoint
[英]Adds an endpoint to the node
[中]将端点添加到节点
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
node.addEndpoint(endpoint);
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
Mockito.when(endpoint2.getEndpointId()).thenReturn(2);
node.addEndpoint(endpoint1);
node.addEndpoint(endpoint2);
代码示例来源:origin: openhab/org.openhab.binding.zigbee
endpoint = new ZigBeeEndpoint(node, endpointId);
endpoint.setProfileId(profileId);
node.addEndpoint(endpoint);
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void testSerialize() {
ZigBeeTransportTransmit mockedTransport = Mockito.mock(ZigBeeTransportTransmit.class);
ZigBeeNetworkManager networkManager = new ZigBeeNetworkManager(mockedTransport);
ZigBeeNode node = new ZigBeeNode(networkManager, new IeeeAddress("1234567890ABCDEF"));
node.setNetworkAddress(12345);
ZigBeeEndpoint endpoint;
endpoint = new ZigBeeEndpoint(node, 1);
endpoint.setProfileId(123);
node.addEndpoint(endpoint);
endpoint = new ZigBeeEndpoint(node, 2);
endpoint.setProfileId(321);
node.addEndpoint(endpoint);
/*
* ZigBeeNodeDao nodeDao = ZigBeeNodeDao.createFromZigBeeNode(node);
* assertEquals(new IeeeAddress("1234567890ABCDEF").toString(), nodeDao.getIeeeAddress());
* assertEquals(Integer.valueOf(12345), nodeDao.getNetworkAddress());
*
* node = ZigBeeNodeDao.createFromZigBeeDao(networkManager, nodeDao);
* assertEquals(new IeeeAddress("1234567890ABCDEF"), node.getIeeeAddress());
* assertEquals(Integer.valueOf(12345), node.getNetworkAddress());
* assertEquals(2, node.getEndpoints().size());
*
* endpoint = node.getEndpoint(1);
* assertEquals(123, endpoint.getProfileId());
*/
}
}
代码示例来源: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
Mockito.verify(node, Mockito.timeout(TIMEOUT).times(1)).addEndpoint(endpointCapture.capture());
内容来源于网络,如有侵权,请联系作者删除!