private void CommandReadyEvent(object sender, SerialDataReceivedEventArgs e)
{
SerialPort sp = (SerialPort)sender;
commandRead = sp.ReadTo("|"); //set to const later
commandRead = commandRead.Replace("\n", "");
commandRead = commandRead.Replace("\r", "");
//commandRead += CommandMetadata.EndDelimiter;
commandRead = "<" + commandRead + ">";
if (MessageQueue != null)
{
MessageQueue.Enqueue(commandRead);
Console.WriteLine(commandRead);
// Console.WriteLine("banana");
}
else
{
Console.WriteLine(commandRead); //Replace with enqueueing data
}
}