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

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

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

ZigBeeNode.setNeighbors介绍

[英]Set the list of neighbors as a NeighborTable.

This method checks to see if there have been "significant" changes to the neighbors list so that we can avoid bothering higher layers if nothing noteworthy has changed.
[中]将邻居列表设置为邻居表。
这种方法会检查邻居列表是否有“重大”变化,这样,如果没有什么值得注意的变化,我们就可以避免打扰更高层。

代码示例

代码示例来源: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

node.setNeighbors(neighbors);

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

neighbors.add(getNeighborTable(new int[] { 0xB1, 0x68, 0xDE, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x86, 0x06, 0x00,
    0x00, 0x00, 0xEE, 0x1F, 0x00, 0xA9, 0x44, 0x25, 0x02, 0x0F, 0xE2 }));
node.setNeighbors(neighbors);
newNode.setNeighbors(neighbors);
assertFalse(node.updateNode(newNode));
neighbors.add(getNeighborTable(new int[] { 0xB1, 0x68, 0xDE, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x84, 0x06, 0x00,
    0x00, 0x00, 0xEE, 0x1F, 0x00, 0xA9, 0x44, 0x25, 0x02, 0x0F, 0xE2 }));
newNode.setNeighbors(neighbors);
assertTrue(node.updateNode(newNode));
neighbors.add(getNeighborTable(new int[] { 0xB0, 0x68, 0xDE, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x84, 0x06, 0x00,
    0x00, 0x00, 0xEE, 0x1F, 0x00, 0xA9, 0x44, 0x25, 0x02, 0x0F, 0xE2 }));
newNode.setNeighbors(neighbors);
assertTrue(node.updateNode(newNode));
newNode.setNeighbors(neighbors);
assertFalse(node.updateNode(newNode));
assertTrue(node.setNeighbors(null));
assertEquals(0, node.getNeighbors().size());

相关文章