Commit Graph
4 Commits
Author SHA1 Message Date
JakubandClaude Sonnet 5 300f5fab0b refactor(prefs): group NodePrefs fields thematically; add real NodePrefs unit tests
NodePrefs.h's field declaration order used to just be historical append
order (on-disk format is defined solely by DataStore's explicit rd()/wr()
sequence, not struct layout), making the file hard to navigate. Reordered
fields into thematic groups (radio, repeater, bot, GPS/trail/location,
display/keyboard, etc.) with no on-disk/schema change; fixed two comments
that had gone stale (favourite_contacts/_kinds' [del→...] tags only named
one of the two handlers that actually clear them; dashboard_fields was
miscategorized under favourites). sizeof(NodePrefs) shifted twice as a
side effect of packing (2760→2752→2760) — verified via real builds on all
four canonical envs and re-checked against the serialization tripwire.

Also replaced test_companion_node_prefs.cpp's dead body (a disabled test
against a saveSerial/loadSerial API this struct never got) with real
coverage of the pure helper functions NodePrefs.h already carries -- band
bucketing, repeater-profile bounds, alarm-repeat round-trip, and every
option-lookup table, including their inconsistent out-of-range fallback
behaviour.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-01 21:56:57 +02:00
MarekZegare4 3d2ba72b17 fix(test): add missing Arduino.h include in ported companion NodePrefs test
Upstream's version transitively pulls Stream in via NodePrefs.h ->
ConfigSerializer.h -> Arduino.h. Our fork's companion NodePrefs.h is a
plain, manually-serialized struct (no ConfigSerializer), so that chain
doesn't exist here and Stream was undeclared. Include it directly,
matching every other file in this codebase that needs Stream.

The test body itself stays #if 0 (upstream: "cannot be set yet"), so
this only fixes the build, not test coverage.
2026-08-14 16:19:14 +02:00
Scott Powell e78bff0041 * unit test no longer valid 2026-08-14 16:42:54 +10:00
agessaman e2aa7b98f9 feat(companion_radio): add external FEM gain preferences for RX and TX for companions
Introduced consistent preferences for external LoRa FEM RX and TX gain settings in NodePrefs. Updated companion MyMesh to apply these settings during initialization and transmission. Added unit tests to verify the round-trip serialization of these new preferences.
2026-08-10 11:59:26 -07:00