Firmware · Protocol · Mobile · Desktop
A bug could start in the UI and end in firmware.
A connected hardware platform
A consumer hardware line with a companion app. Over several years I owned the embedded firmware, the protocol it speaks, the codec library that encodes and decodes it, the cross-platform app that drives it, and the desktop tool engineers use to inspect and flash units in the field.
The earlier devices were passive — the app played audio and they did something physical with it. The newer one is active, closer to a media player with its own storage, and it needed to be talked to. A third-party vendor shipped its first firmware doing that by sending serialized JSON over Bluetooth Classic. It worked, and it was enormously wasteful.
I argued for a real protocol instead: a byte-level encoding with framing, a control byte carrying type and command, and a length-prefixed payload — written down as a specification rather than left implicit in whichever codebase spoke it last. That was a harder sell than it sounds, because the thing it replaced already worked.
It paid for itself twice. I later took over the firmware from the vendor and built on it, which is a great deal easier when the wire format is a document rather than a habit — and the same document is what lets the client commission hardware from someone else entirely. Then I moved the transport from Bluetooth Classic to BLE, which is what finally let iOS users in; Classic had effectively made it Android-only. The codec did not change. Consider what that migration would have looked like still shipping JSON, into BLE's packet sizes.
The rest was less elegant. The native audio player needed capabilities neither web view gave me, so I wrote a proper Capacitor plugin with iOS and Android implementations behind one interface rather than special-casing per platform in app code. A device-name field computed its length in UTF-16 code units while the payload was UTF-8, so accented names were silently truncated on the wire — and a 256-byte name wrapped to zero, which the protocol defines as leave unchanged, turning a rename into a convincing no-op. Auditing that turned up a use-after-free in the firmware's rename handler that had been there since the first commit.
The one I remember is a test jig that would not talk to one particular USB bridge chip. It was a wiring fault, and it was fixed with a soldering iron rather than a commit — which is why there is no trace of it in the history at all.