gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-16 08:07:31 24 4
gpt4 key购买 nike

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

ZigBeeEndpoint.<init>介绍

[英]Constructor
[中]建造师

代码示例

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

public void setDao(ZigBeeNodeDao dao) {
  ieeeAddress = new IeeeAddress(dao.getIeeeAddress());
  networkAddress = dao.getNetworkAddress();
  nodeDescriptor = dao.getNodeDescriptor();
  powerDescriptor = dao.getPowerDescriptor();
  if (dao.getBindingTable() != null) {
    bindingTable.addAll(dao.getBindingTable());
  }
  for (ZigBeeEndpointDao endpointDao : dao.getEndpoints()) {
    ZigBeeEndpoint endpoint = new ZigBeeEndpoint(this, endpointDao.getEndpointId());
    endpoint.setDao(endpointDao);
    endpoints.put(endpoint.getEndpointId(), endpoint);
  }
}

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

private ZigBeeEndpoint getEndpoint() {
    ZigBeeTransportTransmit mockedTransport = Mockito.mock(ZigBeeTransportTransmit.class);
    ZigBeeNetworkManager networkManager = new ZigBeeNetworkManager(mockedTransport);
    ZigBeeNode node = new ZigBeeNode(networkManager, new IeeeAddress());
    node.setNetworkAddress(1234);
    return new ZigBeeEndpoint(node, 5);
  }
}

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

endpoint = new ZigBeeEndpoint(node, endpointId);
endpoint.setProfileId(profileId);
node.addEndpoint(endpoint);

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

@Test
public void testNodeNetworkAddressUpdate() {
  mockedTransport = Mockito.mock(ZigBeeTransportTransmit.class);
  mockedApsFrameListener = ArgumentCaptor.forClass(ZigBeeApsFrame.class);
  ZigBeeNetworkManager networkManager = new ZigBeeNetworkManager(mockedTransport);
  ZigBeeNode node = new ZigBeeNode(networkManager, new IeeeAddress("12345678990ABCDEF"));
  node.setNetworkAddress(12345);
  ZigBeeEndpoint endpoint = new ZigBeeEndpoint(node, 1);
  ZclOnOffCluster cluster = new ZclOnOffCluster(endpoint);
  networkManager.setSerializer(DefaultSerializer.class, DefaultDeserializer.class);
  Mockito.doNothing().when(mockedTransport).sendCommand(mockedApsFrameListener.capture());
  cluster.onCommand();
  assertEquals(12345, mockedApsFrameListener.getValue().getDestinationAddress());
  node.setNetworkAddress(54321);
  cluster.offCommand();
  assertEquals(54321, mockedApsFrameListener.getValue().getDestinationAddress());
}

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

@Test
  public void testSerialize() {
    ZigBeeTransportTransmit mockedTransport = Mockito.mock(ZigBeeTransportTransmit.class);
    ZigBeeNetworkManager networkManager = new ZigBeeNetworkManager(mockedTransport);
    ZigBeeNode node = new ZigBeeNode(networkManager, new IeeeAddress("1234567890ABCDEF"));
    node.setNetworkAddress(12345);

    ZigBeeEndpoint endpoint;
    endpoint = new ZigBeeEndpoint(node, 1);
    endpoint.setProfileId(123);
    node.addEndpoint(endpoint);
    endpoint = new ZigBeeEndpoint(node, 2);
    endpoint.setProfileId(321);
    node.addEndpoint(endpoint);
    /*
     * ZigBeeNodeDao nodeDao = ZigBeeNodeDao.createFromZigBeeNode(node);
     * assertEquals(new IeeeAddress("1234567890ABCDEF").toString(), nodeDao.getIeeeAddress());
     * assertEquals(Integer.valueOf(12345), nodeDao.getNetworkAddress());
     *
     * node = ZigBeeNodeDao.createFromZigBeeDao(networkManager, nodeDao);
     * assertEquals(new IeeeAddress("1234567890ABCDEF"), node.getIeeeAddress());
     * assertEquals(Integer.valueOf(12345), node.getNetworkAddress());
     * assertEquals(2, node.getEndpoints().size());
     *
     * endpoint = node.getEndpoint(1);
     * assertEquals(123, endpoint.getProfileId());
     */
  }
}

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

node.setNetworkAddress(networkAddress.getAddress());
node.setNodeDescriptor(nodeDescriptor);
ZigBeeEndpoint endpoint = new ZigBeeEndpoint(node, networkAddress.getEndpoint());

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

ZigBeeEndpoint endpoint = new ZigBeeEndpoint(node, endpointId);
SimpleDescriptor simpleDescriptor = simpleDescriptorResponse.getSimpleDescriptor();
endpoint.setProfileId(simpleDescriptor.getProfileId());

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

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