本文整理了Java中com.zsmartsystems.zigbee.ZigBeeCommand.getSourceAddress()
方法的一些代码示例,展示了ZigBeeCommand.getSourceAddress()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZigBeeCommand.getSourceAddress()
方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.ZigBeeCommand
类名称:ZigBeeCommand
方法名:getSourceAddress
[英]Gets source address.
[中]获取源地址。
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Override
public boolean isTransactionMatch(ZigBeeCommand request, ZigBeeCommand response) {
if (!request.getDestinationAddress().equals(response.getSourceAddress())) {
return false;
}
if (response instanceof ZclCommand && ((ZclCommand) request).getTransactionId() != null) {
final int transactionId = ((ZclCommand) request).getTransactionId();
return Integer.valueOf(transactionId).equals(((ZclCommand) response).getTransactionId());
} else {
return false;
}
}
}
代码示例来源: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
matchResponse.setMatchList(matchList);
matchResponse.setDestinationAddress(command.getSourceAddress());
matchResponse.setNwkAddrOfInterest(matchRequest.getNwkAddrOfInterest());
logger.debug("{}: ClusterMatcher sending match {}", networkManager.getZigBeeExtendedPanId(), matchResponse);
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
Mockito.when(zigbeeAddress.getAddress()).thenReturn(124);
ZigBeeCommand zigbeeCommandInvalidAddressCmd = Mockito.mock(ZigBeeCommand.class);
Mockito.when(zigbeeCommandInvalidAddressCmd.getSourceAddress()).thenReturn(zigbeeAddress);
node.commandReceived(zigbeeCommandInvalidAddressCmd);
Mockito.verify(endpoint1, Mockito.times(0)).commandReceived(ArgumentMatchers.any(ZclCommand.class));
内容来源于网络,如有侵权,请联系作者删除!