Embedded Developer

Case File: What The Terminal Typed

A firmware parser must never trust what arrives on a serial port: a missing argument, a number out of range or a corrupted line must give a clear error and change nothing. Parse lines of GET, SET and RESET commands that may be in any case and have extra spaces, verify an XOR checksum, check the arguments in a fixed order, report the first error, count the errors, and keep the settings that good commands changed. Run it on lines that you cannot see. The lines are generated for you alone.

50 min

Case File: What The Terminal Typed

A firmware parser must never trust what arrives on a serial port: a missing argument, a number out of range or a corrupted line must give a clear error and change nothing. Parse lines of GET, SET and RESET commands that may be in any case and have extra spaces, verify an XOR checksum, check the arguments in a fixed order, report the first error, count the errors, and keep the settings that good commands changed. Run it on lines that you cannot see. The lines are generated for you alone.

In this lesson:

  • serial
  • parser
  • checksum
  • validation
  • python
  • case-file

๐Ÿ”’ This lesson is part of a paid plan

This lesson is part of the Pro plan. Upgrade to unlock the full lesson, the labs and the exam.

Upgrade Now

This lesson is part of a paid plan

Upgrade to Pro to unlock this course, its labs and its exam.

View Pricing Plans