public BciSerialAdapter(SerialDevice device)
        {
            _port          = new SerialWrapper(device);
            _receiveBuffer = new MemoryStream();

            _port.DataReceived += OnDataReceived;
        }
 public void ClosePort()
 {
     if (_port == null)
     {
         return;
     }
     _port.DataReceived -= OnDataReceived;
     _port.Dispose();
     _port = null;
 }