File tree Expand file tree Collapse file tree
ThreeByte.LinkLib.SerialLink
ThreeByte.LinkLib.TcpLink Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ public class SerialLink : IDisposable
1414 public event EventHandler ? DataReceived ;
1515 public bool IsConnected => _isConnected ;
1616 public bool IsEnabled => _isEnabled ;
17+ public bool IsOpen => _serialPort ? . IsOpen ?? false ;
1718 public bool HasData => _incomingData . Count > 0 ;
1819
1920 private const int MaxDataSize = 100 ;
Original file line number Diff line number Diff line change @@ -391,7 +391,7 @@ private void ReadCallback(IAsyncResult asyncResult)
391391 /// Fetches and removes (pops) the next available group of bytes as received on this link in order (FIFO)
392392 /// </summary>
393393 /// <returns>null if the link is not Enabled or there is no data currently queued to return, an array of bytes otherwise.</returns>
394- public byte [ ] GetMessage ( )
394+ public byte [ ] ? GetMessage ( )
395395 {
396396 if ( _isDisposed )
397397 {
@@ -404,7 +404,7 @@ public byte[] GetMessage()
404404 return null ;
405405 }
406406
407- byte [ ] newMessage = null ;
407+ byte [ ] ? newMessage = null ;
408408 lock ( _incomingData )
409409 {
410410 if ( HasData )
You can’t perform that action at this time.
0 commit comments