gpt4 book ai didi

com.zsmartsystems.zigbee.app.discovery.ZigBeeNodeServiceDiscoverer.getTasks()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 06:53:31 28 4
gpt4 key购买 nike

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

ZigBeeNodeServiceDiscoverer.getTasks介绍

[英]Gets the collection of NodeDiscoveryTasks that are currently outstanding for this discoverer
[中]获取此发现者当前未完成的NodeDiscoveryTask集合

代码示例

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

private void displayNodeMesh(ZigBeeNode node, ZigBeeNodeServiceDiscoverer discoverer, PrintStream out) {
  out.println("IEEE Address             : " + node.getIeeeAddress().toString());
  out.println("NWK Address              : " + node.getNetworkAddress().toString());
  out.println("Last discovery started : " + discoverer.getLastDiscoveryStarted() == null ? NEVER
      : dfIso8601.format(discoverer.getLastDiscoveryStarted().getTime()));
  out.println("Last discovery completed : " + discoverer.getLastDiscoveryCompleted() == null ? NEVER
      : dfIso8601.format(discoverer.getLastDiscoveryStarted().getTime()));
  out.println("Current tasks            : " + tasksToString(discoverer.getTasks()));
}

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

private void outputDiscoveryTasks(ZigBeeDiscoveryExtension extension, PrintStream out) {
  out.println("Mesh update period : " + extension.getUpdatePeriod() + " seconds");
  out.println();
  out.println("Address           Nwk    Last Start            Last Complete         Current Tasks");
  for (ZigBeeNodeServiceDiscoverer discoverer : extension.getNodeDiscoverers()) {
    ZigBeeNode node = discoverer.getNode();
    out.println(String.format("%s  %-5d  %-20s  %-20s  %s", node.getIeeeAddress(), node.getNetworkAddress(),
        discoverer.getLastDiscoveryStarted() == null ? NEVER
            : dfIso8601.format(discoverer.getLastDiscoveryStarted().getTime()),
        discoverer.getLastDiscoveryCompleted() == null ? NEVER
            : dfIso8601.format(discoverer.getLastDiscoveryCompleted().getTime()),
        tasksToString(discoverer.getTasks())));
  }
}

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

@Test
  public void testLocal() throws Exception {
    ZigBeeNode node = Mockito.mock(ZigBeeNode.class);
    ZigBeeNodeServiceDiscoverer discoverer = new ZigBeeNodeServiceDiscoverer(networkManager, node);

    TestUtilities.setField(ZigBeeNodeServiceDiscoverer.class, discoverer, "retryPeriod", 1);

    NodeDescriptor initialNodeDescriptor = Mockito.mock(NodeDescriptor.class);
    Mockito.when(initialNodeDescriptor.getLogicalType()).thenReturn(LogicalType.UNKNOWN);
    Mockito.when(node.getNodeDescriptor()).thenReturn(initialNodeDescriptor);

    PowerDescriptor initialPowerDescriptor = Mockito.mock(PowerDescriptor.class);
    Mockito.when(initialPowerDescriptor.getCurrentPowerMode()).thenReturn(CurrentPowerModeType.UNKNOWN);
    Mockito.when(node.getPowerDescriptor()).thenReturn(initialPowerDescriptor);

    // Use node 0 and we should not try and get the local endpoints
    Mockito.when(node.getNetworkAddress()).thenReturn(0);

    ScheduledFuture<?> futureTask = Mockito.mock(ScheduledFuture.class);
    TestUtilities.setField(ZigBeeNodeServiceDiscoverer.class, discoverer, "futureTask", futureTask);

    discoverer.startDiscovery();

    Mockito.verify(futureTask, Mockito.times(1)).cancel(true);

    assertFalse(discoverer.getTasks().contains(NodeDiscoveryTask.ACTIVE_ENDPOINTS));
  }
}

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

assertEquals(10, discoverer.getMaxBackoff());
assertTrue(discoverer.getTasks().isEmpty());
assertTrue(discoverer.getTasks().contains(NodeDiscoveryTask.ACTIVE_ENDPOINTS));

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