public void Dispose()
        {
            if (_poll != null)
            {
                _poll.Stop();
                _poll = null;
            }

            if (_client != null)
            {
                _client.Disconnect();
                _client = null;
            }

            if (_master != null)
            {
                _master.DisconnectAllDevices();
                _master = null;
            }

            if (_slave != null)
            {
                _slave.Terminate();
                _slave = null;
            }

            Task.Delay(1000).Wait();
        }
        public void Dispose()
        {
            if (_client != null)
            {
                _client.Disconnect();
                _client.Dispose();
                _client = null;
            }

            if (_master != null)
            {
                _master.DisconnectAllDevices();
                _master = null;
            }

            if (_slave != null)
            {
                _slave.Terminate();
                _slave = null;
            }
        }