本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.getEndpoint()
方法的一些代码示例,展示了ZigBeeNode.getEndpoint()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZigBeeNode.getEndpoint()
方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.ZigBeeNode
类名称:ZigBeeNode
方法名:getEndpoint
[英]Gets an endpoint given the ZigBeeAddress address.
[中]获取给定ZigBeeAddress的终结点。
代码示例来源:origin: openhab/org.openhab.binding.zigbee
public ZigBeeEndpoint getEndpoint(IeeeAddress address, int endpointId) {
if (networkManager == null) {
return null;
}
ZigBeeNode node = networkManager.getNode(address);
if (node == null) {
return null;
}
return node.getEndpoint(endpointId);
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
out.println("Endpoints : ");
for (Integer endpointId : endpointIds) {
ZigBeeEndpoint endpoint = node.getEndpoint(endpointId);
out.print(String.format(" %-3d : ", endpoint.getEndpointId()));
outputEndpoint(out, endpoint);
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
ZigBeeEndpoint endpoint = node.getEndpoint(endpointId);
out.println(String.format("%-3d %-25s %s", endpoint.getEndpointId(),
ZigBeeProfileType.getByValue(endpoint.getProfileId()),
代码示例来源:origin: openhab/org.openhab.binding.zigbee
ZigBeeEndpoint endpoint = node.getEndpoint(endpointId);
ZclCluster cluster;
if (direction) {
代码示例来源: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
/**
* Switches destination on.
*
* @param destination the {@link ZigBeeAddress}
* @return the command result future.
*/
public Future<CommandResult> on(final ZigBeeAddress destination) {
if (!(destination instanceof ZigBeeEndpointAddress)) {
return null;
}
ZigBeeEndpointAddress endpointAddress = (ZigBeeEndpointAddress) destination;
ZigBeeEndpoint endpoint = networkManager.getNode(endpointAddress.getAddress())
.getEndpoint(endpointAddress.getEndpoint());
if (endpoint == null) {
return null;
}
ZclOnOffCluster cluster = (ZclOnOffCluster) endpoint.getInputCluster(ZclOnOffCluster.CLUSTER_ID);
return cluster.onCommand();
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
ZigBeeEndpoint endpoint = node.getEndpoint(endpointId);
if (endpoint == null) {
int profileId;
内容来源于网络,如有侵权,请联系作者删除!