Goal
Build a Python decoder that reads an encoded binary log byte-by-byte (simulating a live serial stream) and reconstructs human-readable telemetry frames against a published protocol specification
What I did
- A streaming decoder in Python that processes one byte at a time, locating frame boundaries on the fly by scanning for the protocol’s
~~start-of-frame marker — the same frame-synchronisation pattern used in real serial receivers. - Per-frame parsing of a 26-byte protocol covering device IDs, sequence number, RPM and voltage as big-endian uint16, current as little-endian int16, MOSFET and capacitor temperatures via lookup table, a 64-bit Unix microsecond timestamp, and a one-byte checksum — handled cleanly using Python’s
structmodule. - A multi-layer corruption-detection pipeline: validating the
Ppayload andTtiming markers, catching lookup-table misses on temperature bytes, and verifying the protocol’s255 − (sum mod 256)checksum on every frame. - CSV export with corrupt frames retained but flagged, per the brief.
Outcome
Decoded 628 complete frames from the assigned binary; 16 flagged as potentially corrupt; all timestamps successfully resolved to Tuesday, 19 April 2005

