Skip to content

Commit

Permalink
ThroughSerial byte stuffing bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
gioblu committed Jan 28, 2018
1 parent 0158bf1 commit ae58366
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions strategies/ThroughSerial/ThroughSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ae58366

Please # to comment.