Пример #1
0
 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());
 }
Пример #2
0
 public override Task <bool> Stop()
 {
     if (_tunneling != null)
     {
         _tunneling.OnDatagramReceived -= KnxEventDelegate;
         _tunneling.OnConnected        -= KnxConnectedEvent;
         _tunneling.OnDisconnected     -= KnxDisconnectedEvent;
     }
     _callbackMap.Clear();
     _tunneling?.Stop();
     return(base.Stop());
 }
Пример #3
0
        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();
            }
        }