use of com.zsmartsystems.zigbee.zcl.ZclCommand in project com.zsmartsystems.zigbee by zsmartsystems.
the class ZigBeeNetworkDiscoverer method commandReceived.
@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());
}
}
// Node has been announced.
if (command instanceof DeviceAnnounce) {
final DeviceAnnounce announce = (DeviceAnnounce) command;
// startNodeDiscovery(address.getNwkAddrOfInterest());
addNode(announce.getIeeeAddr(), announce.getNwkAddrOfInterest());
}
}
Aggregations