mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-14 04:57:15 +00:00
Adds try/catch to Communication_BytesReceived callback to prevent exception from getting logged when malformed message is received
This commit is contained in:
parent
47f4d90c5a
commit
1017464980
1 changed files with 70 additions and 63 deletions
|
|
@ -166,6 +166,8 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender"></param>
|
/// <param name="sender"></param>
|
||||||
void Communication_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs e)
|
void Communication_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
// This is probably not thread-safe buffering
|
// This is probably not thread-safe buffering
|
||||||
// Append the incoming bytes with whatever is in the buffer
|
// Append the incoming bytes with whatever is in the buffer
|
||||||
|
|
@ -246,6 +248,11 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||||
// Save whatever partial message is here
|
// Save whatever partial message is here
|
||||||
IncomingBuffer = newBytes;
|
IncomingBuffer = newBytes;
|
||||||
}
|
}
|
||||||
|
catch (Exception err)
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Error parsing feedback: {0}", err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue