public async Task <IEnumerable <byte> > TransceiveAsync(byte[] request, CancellationToken cancellationToken) { var wasOpenBefore = _inner.IsOpen; if (!wasOpenBefore) { _inner.Open(); } var result = await _inner.TransceiveAsync(request, cancellationToken); if (PortMustBeClosed(wasOpenBefore)) { _inner.Close(); } return(result); }
public void Close() { _inner.Close(); _semaphore.Release(); }
public void Close() { _serialPortTransceiverImplementation.Close(); }
public void Close() => _transceiver.Close();