gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-19 05:29:31 25 4
gpt4 key购买 nike

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

ZigBeeAddress.getAddress介绍

[英]Gets the network address for this address.
[中]获取此地址的网络地址。

代码示例

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

break;
case GROUP:
  builder.append(destinationAddress.getAddress());
  break;
case NWK:

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

@Override
public void commandReceived(ZigBeeCommand command) {
  // This gets called for all received commands
  // Check if it's our address
  if (command.getSourceAddress().getAddress() != networkAddress) {
    return;
  }
  if (!(command instanceof ZclCommand)) {
    return;
  }
  logger.trace("{}: ZigBeeEndpoint.commandReceived({})", ieeeAddress, command);
  ZclCommand zclCommand = (ZclCommand) command;
  ZigBeeEndpointAddress endpointAddress = (ZigBeeEndpointAddress) zclCommand.getSourceAddress();
  ZigBeeEndpoint endpoint = endpoints.get(endpointAddress.getEndpoint());
  if (endpoint != null) {
    endpoint.commandReceived(zclCommand);
  }
}

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

Mockito.when(zigbeeAddress.getAddress()).thenReturn(124);
ZigBeeCommand zigbeeCommandInvalidAddressCmd = Mockito.mock(ZigBeeCommand.class);
Mockito.when(zigbeeCommandInvalidAddressCmd.getSourceAddress()).thenReturn(zigbeeAddress);
Mockito.when(zdoSource.getAddress()).thenReturn(12345);
Mockito.when(zdoCommand.getSourceAddress()).thenReturn(zdoSource);
node.commandReceived(zdoCommand);

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

@Override
public void commandReceived(final ZigBeeCommand command) {
  // ZCL command received from remote node. Perform discovery if it is not yet known.
  if (command instanceof ZclCommand) {
    final ZclCommand zclCommand = (ZclCommand) command;
    if (networkManager.getNode(zclCommand.getSourceAddress().getAddress()) == null) {
      // TODO: Protect against group address?
      ZigBeeEndpointAddress address = (ZigBeeEndpointAddress) zclCommand.getSourceAddress();
      startNodeDiscovery(address.getAddress());
    }
    return;
  }
  // Node has been announced.
  if (command instanceof DeviceAnnounce) {
    final DeviceAnnounce announce = (DeviceAnnounce) command;
    logger.debug("{}: Device announce received. NWK={}", announce.getIeeeAddr(),
        announce.getNwkAddrOfInterest());
    addNode(announce.getIeeeAddr(), announce.getNwkAddrOfInterest());
  }
}

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

@Test
  public void testMatcherMatchInOut() {
    ClusterMatcher matcher = getMatcher();
    matcher.addCluster(0x500);
    matcher.addCluster(0x600);

    List<Integer> clusterListIn = new ArrayList<Integer>();
    List<Integer> clusterListOut = new ArrayList<Integer>();
    clusterListIn.add(0x500);
    clusterListOut.add(0x500);
    MatchDescriptorRequest request = new MatchDescriptorRequest();
    request.setSourceAddress(new ZigBeeEndpointAddress(1234, 5));
    request.setNwkAddrOfInterest(4321);
    request.setProfileId(0x104);
    request.setInClusterList(clusterListIn);
    request.setOutClusterList(clusterListOut);

    matcher.commandReceived(request);
    assertEquals(1, mockedCommandCaptor.getAllValues().size());
    MatchDescriptorResponse response = (MatchDescriptorResponse) mockedCommandCaptor.getValue();
    assertEquals(1234, response.getDestinationAddress().getAddress());
    assertEquals(Integer.valueOf(4321), response.getNwkAddrOfInterest());
  }
}

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

switch (destinationAddressMode) {
  case GROUP:
    serializeUInt16(destinationAddress.getAddress());
    break;
  case IEEE:
    break;
  case NWK:
    serializeUInt16(destinationAddress.getAddress());
    serializeUInt8(((ZigBeeEndpointAddress) destinationAddress).getEndpoint());
    break;

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

apsFrame.setDestinationEndpoint(((ZigBeeEndpointAddress) command.getDestinationAddress()).getEndpoint());
ZigBeeNode node = getNode(command.getDestinationAddress().getAddress());
if (node != null) {
  apsFrame.setDestinationIeeeAddress(node.getIeeeAddress());

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