public override Task <bool> Stop() { lock (_lock) { KnxHelper.Logger.LogInformation($"Stopping KNX driver..."); if (_tunneling != null) { _tunneling.Stop(); _callbackMap.Clear(); _tunneling = null; } } return(base.Stop()); }
public override Task <bool> Stop() { if (_tunneling != null) { _tunneling.OnDatagramReceived -= KnxEventDelegate; _tunneling.OnConnected -= KnxConnectedEvent; _tunneling.OnDisconnected -= KnxDisconnectedEvent; } _callbackMap.Clear(); _tunneling?.Stop(); return(base.Stop()); }
private void KnxDisconnectedEvent(object sender, EventArgs eventArgs) { lock (_lock) { KnxHelper.Logger.LogDebug($"GW {Name} disconnected"); _gwState?.SetGatewayState(false); _tunneling.Stop(); Thread.Sleep(1000); _tunneling.Start(); } }