|
|
|
|
@ -113,7 +113,9 @@ internal class Program |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
byte[] msgBytes = Encoding.ASCII.GetBytes(message!); |
|
|
|
|
List<byte> listBytes = msgBytes.ToList(); |
|
|
|
|
List<byte> listBytes = new List<byte>(); |
|
|
|
|
listBytes.Add((byte)' '); // temp fix for first sign wrong |
|
|
|
|
listBytes.AddRange(msgBytes); |
|
|
|
|
listBytes.Add((byte)'\n'); |
|
|
|
|
_device.Write(listBytes.ToArray()); |
|
|
|
|
} |
|
|
|
|
@ -176,8 +178,11 @@ internal class Program |
|
|
|
|
string print = Encoding.UTF8.GetString(readData.Data); |
|
|
|
|
//print = print.Replace("\r", "").Replace("\n", ""); // Newline Mode: none |
|
|
|
|
//print = print.Replace("\r", ""); // Newline Mode: only print \n |
|
|
|
|
//print = print.Replace("\n", ""); // Newline Mode: only print \r |
|
|
|
|
Console.Write(print); |
|
|
|
|
print = print.Replace("\0", ""); // delete null chars |
|
|
|
|
if(String.IsNullOrEmpty(print) == false) |
|
|
|
|
{ |
|
|
|
|
Console.Write(print); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
catch (TimeoutException) { } |
|
|
|
|
|