From 3ef0f0e7cda0194edd1c0142b5b8831b6161bc4b Mon Sep 17 00:00:00 2001 From: The6P4C Date: Fri, 29 Sep 2017 11:20:10 +1000 Subject: [PATCH] Add TODO to possibly improve packet parser --- ThunderboltTimeSync/ThunderboltSerialPort.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ThunderboltTimeSync/ThunderboltSerialPort.cs b/ThunderboltTimeSync/ThunderboltSerialPort.cs index abf5bc3..00225ed 100644 --- a/ThunderboltTimeSync/ThunderboltSerialPort.cs +++ b/ThunderboltTimeSync/ThunderboltSerialPort.cs @@ -127,6 +127,10 @@ namespace ThunderboltTimeSync { PacketReceived?.Invoke(packet); } + // TODO: Improve this? Currently, if a malformed packet comes in it can take many more packets (totalling up to almost 5 to 10 seconds of time) + // to bring the decoder back into sync with the true packets. It's probably only an issue when the Thunderbolt is initially plugged in, + // as that's probably the only time we'd see malformed packets on the serial port, since we could connect in the middle of a packet. + // Consider if this is really an issue, and think of a better way of decoding the packets to avoid this. private void DataReceived(object sender, SerialDataReceivedEventArgs e) { int possibleCurrentByte;