use of com.zsmartsystems.zigbee.zdo.command.NodeDescriptorRequest in project com.zsmartsystems.zigbee by zsmartsystems.
the class ZigBeeNodeServiceDiscoverer method requestNodeDescriptor.
/**
* Get node descriptor
*
* @return true if the message was processed ok
* @throws ExecutionException
* @throws InterruptedException
*/
private boolean requestNodeDescriptor() throws InterruptedException, ExecutionException {
final NodeDescriptorRequest nodeDescriptorRequest = new NodeDescriptorRequest();
nodeDescriptorRequest.setDestinationAddress(new ZigBeeEndpointAddress(node.getNetworkAddress()));
nodeDescriptorRequest.setNwkAddrOfInterest(node.getNetworkAddress());
CommandResult response = networkManager.unicast(nodeDescriptorRequest, nodeDescriptorRequest).get();
final NodeDescriptorResponse nodeDescriptorResponse = (NodeDescriptorResponse) response.getResponse();
logger.debug("{}: Node SVC Discovery NodeDescriptorResponse returned {}", node.getIeeeAddress(), nodeDescriptorResponse);
if (nodeDescriptorResponse == null) {
return false;
}
if (nodeDescriptorResponse.getStatus() == ZdoStatus.SUCCESS) {
node.setNodeDescriptor(nodeDescriptorResponse.getNodeDescriptor());
return true;
}
return false;
}
Aggregations