mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-02-16 05:04:48 +00:00
Touch-ups on autoreconnect
This commit is contained in:
@@ -32,6 +32,12 @@ namespace PepperDash.Core
|
||||
/// </summary>
|
||||
public IBasicCommunication Port { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Default false. If true, the delimiter will be included in the line output
|
||||
/// events
|
||||
/// </summary>
|
||||
public bool IncludeDelimiter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// For receive buffer
|
||||
/// </summary>
|
||||
@@ -92,7 +98,14 @@ namespace PepperDash.Core
|
||||
if (lines.Length > 0)
|
||||
{
|
||||
for (int i = 0; i < lines.Length - 1; i++)
|
||||
handler(this, new GenericCommMethodReceiveTextArgs(lines[i]));
|
||||
{
|
||||
string strToSend = null;
|
||||
if (IncludeDelimiter)
|
||||
strToSend = lines[i] + Delimiter;
|
||||
else
|
||||
strToSend = lines[i];
|
||||
handler(this, new GenericCommMethodReceiveTextArgs(strToSend));
|
||||
}
|
||||
ReceiveBuffer = new StringBuilder(lines[lines.Length - 1]);
|
||||
}
|
||||
}
|
||||
@@ -117,7 +130,14 @@ namespace PepperDash.Core
|
||||
if (lines.Length > 1)
|
||||
{
|
||||
for (int i = 0; i < lines.Length - 1; i++)
|
||||
handler(this, new GenericCommMethodReceiveTextArgs(lines[i]));
|
||||
{
|
||||
string strToSend = null;
|
||||
if (IncludeDelimiter)
|
||||
strToSend = lines[i] + StringDelimiter;
|
||||
else
|
||||
strToSend = lines[i];
|
||||
handler(this, new GenericCommMethodReceiveTextArgs(strToSend));
|
||||
}
|
||||
ReceiveBuffer = new StringBuilder(lines[lines.Length - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user