gpt4 book ai didi

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

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

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

ZigBeeEndpoint.commandReceived介绍

[英]Incoming command handler. The endpoint will process any commands addressed to this endpoint ID and pass o clusters and applications
[中]传入命令处理程序。该端点将处理寻址到此端点ID的所有命令,并将其传递给集群和应用程序

代码示例

代码示例来源: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(zigbeeCommand.getSourceAddress()).thenReturn(invalidSourceAddress);
node.commandReceived(zigbeeCommand);
Mockito.verify(endpoint1, Mockito.times(0)).commandReceived(ArgumentMatchers.any(ZclCommand.class));
Mockito.verify(endpoint2, Mockito.times(0)).commandReceived(ArgumentMatchers.any(ZclCommand.class));
Mockito.when(zigbeeCommandInvalidAddressCmd.getSourceAddress()).thenReturn(zigbeeAddress);
node.commandReceived(zigbeeCommandInvalidAddressCmd);
Mockito.verify(endpoint1, Mockito.times(0)).commandReceived(ArgumentMatchers.any(ZclCommand.class));
Mockito.verify(endpoint2, Mockito.times(0)).commandReceived(ArgumentMatchers.any(ZclCommand.class));
Mockito.verify(endpoint1, Mockito.times(1)).commandReceived(unicast);
Mockito.verify(endpoint2, Mockito.times(0)).commandReceived(unicast);

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