com.zsmartsystems.zigbee.ZigBeeNode.getNeighbors()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(149)

本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode.getNeighbors()方法的一些代码示例,展示了ZigBeeNode.getNeighbors()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZigBeeNode.getNeighbors()方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.ZigBeeNode
类名称:ZigBeeNode
方法名:getNeighbors

ZigBeeNode.getNeighbors介绍

[英]Get the list of neighbors as a NeighborTable
[中]将邻居列表作为邻居列表

代码示例

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

for (NeighborTable neighbor : node.getNeighbors()) {
  out.println(neighbor.toString());

代码示例来源:origin: openhab/org.openhab.binding.zigbee

jsonBuilder.append('[');
boolean first = true;
for (NeighborTable neighbor : node.getNeighbors()) {
  if (!first) {
    jsonBuilder.append(',');

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

if (!neighbors.equals(node.getNeighbors())) {
  updated = true;
  neighbors.clear();
  neighbors.addAll(node.getNeighbors());

代码示例来源:origin: openhab/org.openhab.binding.zigbee

jsonBuilder.append("[");
boolean first = true;
for (NeighborTable neighbor : node.getNeighbors()) {
  if (!first) {
    jsonBuilder.append(",");

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

@Test
public void testNeighborTableUpdate() {
  ZigBeeNode node = new ZigBeeNode(Mockito.mock(ZigBeeNetworkManager.class), new IeeeAddress());
  Set<NeighborTable> neighbors;
  NeighborTable neighbor1 = getNeighborTable(12345, "123456789", 0);
  NeighborTable neighbor2 = getNeighborTable(12345, "123456789", 0);
  NeighborTable neighbor3 = getNeighborTable(54321, "987654321", 0);
  neighbors = new HashSet<NeighborTable>();
  neighbors.add(neighbor1);
  assertTrue(node.setNeighbors(neighbors));
  neighbors = new HashSet<NeighborTable>();
  neighbors.add(neighbor2);
  assertFalse(node.setNeighbors(neighbors));
  neighbors = new HashSet<NeighborTable>();
  neighbors.add(neighbor3);
  neighbors.add(neighbor1);
  assertTrue(node.setNeighbors(neighbors));
  neighbors = new HashSet<NeighborTable>();
  neighbors.add(neighbor1);
  neighbors.add(neighbor3);
  assertFalse(node.setNeighbors(neighbors));
  assertEquals(2, node.getNeighbors().size());
}

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

assertFalse(node.updateNode(newNode));
assertEquals(2, node.getNeighbors().size());
assertTrue(node.setNeighbors(null));
assertEquals(0, node.getNeighbors().size());

相关文章