From ae583661c1df51564b8d51d97c2b97c1af02dc4b Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 28 Jan 2018 17:40:28 +0100 Subject: [PATCH] ThroughSerial byte stuffing bugfix --- strategies/ThroughSerial/ThroughSerial.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strategies/ThroughSerial/ThroughSerial.h b/strategies/ThroughSerial/ThroughSerial.h index 5970140d33..183f6f409f 100644 --- a/strategies/ThroughSerial/ThroughSerial.h +++ b/strategies/ThroughSerial/ThroughSerial.h @@ -145,10 +145,10 @@ class ThroughSerial { if(result == TS_ESC) { result = receive_byte(); - // Escaping byte-stuffing violation + result ^= TS_ESC; + // Avoid byte-stuffing violation if((result != TS_START) && (result != TS_ESC) && (result != TS_END)) return TS_FAIL; - result ^= TS_ESC; } // No end flag, byte-stuffing violation