gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-15 20:49:31 26 4
gpt4 key购买 nike

本文整理了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());

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com