The TFMini-S driver follows the same UART parsing pattern as TF-Luna, with one critical difference: the 9-byte frame’s fields 4-7 are str_L str_H res mode (signal strength + reserved + mode), not Amp_L Amp_H Temp_L Temp_H like TF-Luna A03.
If you accidentally parse a TFMini-S packet using TF-Luna A03 logic, you’ll get amplitude/temperature values that look reasonable but are wrong — see datasheet pitfalls for the wider class of this bug.
Adapting the TF-Luna driver
Change the frame-parse function:
// TF-Luna A03 parsing — fields 4-7
out.amp_raw = buf[4] | (buf[5] << 8);
out.temp_c = ((buf[6] | (buf[7] << 8)) * 0.125) - 256.0;
// TFMini-S parsing — fields 4-7
out.signal_strength = buf[4] | (buf[5] << 8);
// buf[6] = reserved
// buf[7] = mode (low byte)
Everything else (frame sync, buffer size, health flag, the host-testable pattern) transfers verbatim.