mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 19:02:00 +00:00
refactor(prefs): settings saved as /prefs.json, upstream's ConfigSerializer
NodePrefs is now NodePrefsFields (the fields) plus how they're saved: one JSON key per field, upstream's keys under "radio", "gps", "repeat", "comp" and "custom" (so either firmware reads what the other wrote of them), ours under "solo". Saved atomically (temp file, then renamed), through a buffer. 2.0-rc's binary /prefs is removed, not converted: 2.0 starts from the defaults; /new_prefs from before 2.0 is still imported. From upstream with it: txdelay / direct.txdelay / agc.reset.interval (prefs and CLI), and the board's own settings through getCustom() (Board::attachDynamicPrefs) in place of the merge's stopgap adapter. ConfigSerializer reads values up to 191 characters (was 127): 140-byte texts, an 80-byte table in hex. Test: every field round-trips through the JSON byte for byte; the alarm label tests expect "Once" (the label changed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,9 @@
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_MAX_TOKEN_LEN
|
||||
#define CONFIG_MAX_TOKEN_LEN 128
|
||||
// A value read whole: the companion's longest are 140-byte texts and an
|
||||
// 80-byte table in hex (160).
|
||||
#define CONFIG_MAX_TOKEN_LEN 192
|
||||
#endif
|
||||
|
||||
class ConfigSerializer {
|
||||
|
||||
Reference in New Issue
Block a user