gpt4 book ai didi

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

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

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

ZigBeeEndpointAddress.getEndpoint介绍

[英]Returns the endpoint number
[中]返回端点号

代码示例

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

@Override
public boolean equals(Object obj) {
  if (obj == null) {
    return false;
  }
  if (!ZigBeeEndpointAddress.class.isAssignableFrom(obj.getClass())) {
    return false;
  }
  final ZigBeeEndpointAddress other = (ZigBeeEndpointAddress) obj;
  return (other.getAddress() == getAddress() && other.getEndpoint() == getEndpoint());
}

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

@Override
public int compareTo(ZigBeeAddress that) {
  if (this == that) {
    return 0;
  }
  ZigBeeEndpointAddress thatAddr = (ZigBeeEndpointAddress) that;
  if (thatAddr.getAddress() == getAddress() && thatAddr.getEndpoint() == getEndpoint()) {
    return 0;
  }
  if (thatAddr.getAddress() == getAddress()) {
    return getEndpoint() - thatAddr.getEndpoint();
  }
  return getAddress() - thatAddr.getAddress();
}

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

/**
 * Switches destination on.
 *
 * @param destination the {@link ZigBeeAddress}
 * @return the command result future.
 */
public Future<CommandResult> on(final ZigBeeAddress destination) {
  if (!(destination instanceof ZigBeeEndpointAddress)) {
    return null;
  }
  ZigBeeEndpointAddress endpointAddress = (ZigBeeEndpointAddress) destination;
  ZigBeeEndpoint endpoint = networkManager.getNode(endpointAddress.getAddress())
      .getEndpoint(endpointAddress.getEndpoint());
  if (endpoint == null) {
    return null;
  }
  ZclOnOffCluster cluster = (ZclOnOffCluster) endpoint.getInputCluster(ZclOnOffCluster.CLUSTER_ID);
  return cluster.onCommand();
}

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

Mockito.when(sourceAddress.getEndpoint()).thenReturn(1);
Mockito.when(invalidSourceAddress.getEndpoint()).thenReturn(1);
ZclCommand zigbeeCommand = Mockito.mock(ZclCommand.class);
Mockito.when(zigbeeCommand.getSourceAddress()).thenReturn(invalidSourceAddress);
ZigBeeEndpointAddress unicastDestination = Mockito.mock(ZigBeeEndpointAddress.class);
Mockito.when(unicastDestination.getAddress()).thenReturn(123);
Mockito.when(unicastDestination.getEndpoint()).thenReturn(1);
Mockito.when(unicast.getSourceAddress()).thenReturn(sourceAddress);
Mockito.when(unicast.getDestinationAddress()).thenReturn(unicastDestination);

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

@Test
public void testConstructorZdo() {
  ZigBeeEndpointAddress address = new ZigBeeEndpointAddress(25000);
  assertEquals(25000, address.getAddress());
  assertEquals(0, address.getEndpoint());
}

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

@Test
public void testConstructor() {
  ZigBeeEndpointAddress address = new ZigBeeEndpointAddress(25000, 33);
  assertEquals(25000, address.getAddress());
  assertEquals(33, address.getEndpoint());
}

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

@Test
public void testStringConstructorZdo() {
  ZigBeeEndpointAddress address = new ZigBeeEndpointAddress("25000");
  assertEquals(25000, address.getAddress());
  assertEquals(0, address.getEndpoint());
}

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

@Test
public void testStringConstructor() {
  ZigBeeEndpointAddress address = new ZigBeeEndpointAddress("25000/33");
  assertEquals(25000, address.getAddress());
  assertEquals(33, address.getEndpoint());
}

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

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

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

apsFrame.setAddressMode(ZigBeeNwkAddressMode.DEVICE);
apsFrame.setDestinationAddress(((ZigBeeEndpointAddress) command.getDestinationAddress()).getAddress());
apsFrame.setDestinationEndpoint(((ZigBeeEndpointAddress) command.getDestinationAddress()).getEndpoint());

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

case IEEE:
  serializeUInt8Array(destinationIeeeAddress.getValue());
  serializeUInt8(((ZigBeeEndpointAddress) destinationAddress).getEndpoint());
  break;
case NWK:
  serializeUInt16(destinationAddress.getAddress());
  serializeUInt8(((ZigBeeEndpointAddress) destinationAddress).getEndpoint());
  break;
default:

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