Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions CMRI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,9 @@ void CMRI::transmit()
_serial.write(GET);
for (int i=0; i<_tx_length; i++)
{
if (_tx_buffer[i] == ETX)
_serial.write(ESC); // escape because this looks like an STX bit (very basic protocol)
if (_tx_buffer[i] == ESC)
_serial.write(ESC); // escape because this looks like an escape bit (very basic protocol)
// DLE-escape STX, ETX and DLE characters
if (_tx_buffer[i] == STX || _tx_buffer[i] == ETX || _tx_buffer[i] == ESC)
_serial.write(ESC);
_serial.write(_tx_buffer[i]);
}
_serial.write(ETX);
Expand Down