VSFM omni logging
This commit is contained in:
+6
-12
@@ -107,11 +107,10 @@
|
||||
|
||||
try
|
||||
{
|
||||
var bytesToCopy = serialPort.Read(buffer, 0, size);
|
||||
var copyLength = serialPort.Read(buffer, 0, size);
|
||||
|
||||
bytes = new Byte[bytesToCopy];
|
||||
|
||||
Buffer.BlockCopy(buffer, 0, bytes, 0, bytesToCopy);
|
||||
Array.Resize(ref bytes, copyLength);
|
||||
Array.Copy(buffer, 0, bytes, 0, copyLength);
|
||||
|
||||
this.Notify($"RX|{BitConverter.ToString(bytes)}");
|
||||
}
|
||||
@@ -143,12 +142,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
var lock_obj = new object();
|
||||
|
||||
lock (lock_obj)
|
||||
{
|
||||
serialPort.Write(bytes, start, length);
|
||||
}
|
||||
serialPort.Write(bytes, start, length);
|
||||
|
||||
this.Notify($"TX|{BitConverter.ToString(bytes)}");
|
||||
}
|
||||
@@ -159,7 +153,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
public void Notify(String state)
|
||||
=> this.Logging?.Invoke(state);
|
||||
public void Notify(String message)
|
||||
=> this.Logging?.Invoke(message);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user