Packing a frame to send

  1. Build Message
  2. Calculate CRC
  3. Add CRC MSB and LSB
  4. Replace with escape sequences where necessary
  5. Frame data between a START and END character.
  6. Send message


Unpacking a received frame

  1. Unescape: For each incoming byte after START character until END character reached. Replace escape sequences with original byte.
  2. Calculate CRC
  3. Verify with received CRC
  4. Process incoming message