Minor changes to client and gather in response to wharton/portalsync debugging

This commit is contained in:
Heath Volmer
2017-01-06 13:39:53 -07:00
parent 5fb4150d21
commit e9f4917c55
15 changed files with 170 additions and 4 deletions

View File

@@ -92,6 +92,13 @@ namespace PepperDash.Core
var handler = LineReceived;
if (handler != null)
{
if (Debug.Level >= 2)
{
var output = Regex.Replace(args.Text,
@"\p{Cc}",
a => string.Format("[{0:X2}]", (byte)a.Value[0]));
Debug.Console(2, Port, "RX: '{0}]", output);
}
ReceiveBuffer.Append(args.Text);
var str = ReceiveBuffer.ToString();
var lines = str.Split(Delimiter);
@@ -123,7 +130,13 @@ namespace PepperDash.Core
{
// Receive buffer should either be empty or not contain the delimiter
// If the line does not have a delimiter, append the
if (Debug.Level >= 2)
{
var output = Regex.Replace(args.Text,
@"\p{Cc}",
a => string.Format("[{0:X2}]", (byte)a.Value[0]));
Debug.Console(2, Port, "RX: '{0}]", output);
}
ReceiveBuffer.Append(args.Text);
var str = ReceiveBuffer.ToString();
var lines = Regex.Split(str, StringDelimiter);