public void CommandReceived(ZigBeeCommand command) { // ZCL command received from remote node. Perform discovery if it is not yet known. if (command is ZclCommand zclCommand) { if (_networkManager.GetNode(zclCommand.SourceAddress.Address) == null) { // TODO: Protect against group address? ZigBeeEndpointAddress address = (ZigBeeEndpointAddress)zclCommand.SourceAddress; StartNodeDiscovery(address.Address); } return; } // Node has been announced. if (command is DeviceAnnounce) { DeviceAnnounce announce = (DeviceAnnounce)command; _logger.Debug("{IeeeAddress}: Device announce received. NWK={NetworkAddress}", announce.IeeeAddr, announce.NwkAddrOfInterest); AddNode(announce.IeeeAddr, announce.NwkAddrOfInterest); } }
public void CommandReceived(ZigBeeCommand command) { // Node has been announced. if (command is DeviceAnnounce) { DeviceAnnounce announce = (DeviceAnnounce)command; Log.Debug("{IeeeAddress}: Device announce received. NWK={NetworkAddress}", announce.IeeeAddr, announce.NwkAddrOfInterest); AddNode(announce.IeeeAddr, announce.NwkAddrOfInterest); } }