private void SerialPortDataReceived( object sender, BytesReceivedEventArgs e ) { lock ( _byteStream ) { _byteStream.AddRange( e.Bytes ); // Keep reading until there's no complete chunk to be read. while ( ReadAndProcessBytes() ) { } } }
private void SerialPortDataReceived(object sender, BytesReceivedEventArgs e) { lock ( _byteStream ) { _byteStream.AddRange(e.Bytes); // Keep reading until there's no complete chunk to be read. while (ReadAndProcessBytes()) { } } }