Align flood-scope handling with firmware semantics#91
Conversation
Treat a 16-byte all-zero flood scope key as an explicit disabled scope instead of a transient transport key. This keeps Remote Terminal empty flood_scope sends as plain flood packets, including when a default scope is configured. Add regression tests for zero-key disabling, persistent default-scope bypass, and clearing the disabled state.
|
The inconsistency comes down to one wire message ( What meshcore_py (and thus RemoteTerm) means by it: its What this PR does: it adds What the firmware does: the all-zero key makes So the divergence is precisely the default-scope case:
I would prefer to conform to the firmware's interpretation and send There is also a behavior change in OpenHop_core that is necessary, because we currently treat mode-1 switches as single-shot. Instead, we need to treat them as sticky. This change was done in Companion Version 12 without any fanfare, although the app still sends the Basically, this PR would fix RemoteTerm and other meshcore_py-based apps, but would break firmware consistency. Let me know if you want to do the PR to fix meshcore_py or I can send one over. |
Treat SET_FLOOD_SCOPE mode 0 with an all-zero key as a null override so default flood scope still applies, matching firmware behavior. Make explicit unscoped mode sticky until a mode 0 scope set/reset, reject unsupported flood scope modes, and update tests/docs for the firmware semantics.
Updated this to match the firmware semantics rather than the previous meshcore_py interpretation. SET_FLOOD_SCOPE mode 0 with an all-zero key is now treated as a null override, so it falls back to the configured default scope instead of forcing plain flood. Explicit unscoped sending is now handled via mode 1 and remains sticky until a mode 0 set/reset, matching Companion v12 behavior. I also tightened unsupported mode handling and added/updated tests for the zero-key default-scope case and sticky unscoped behavior. Full test suite passes locally: 900 passed. I can send a PR to RemoteTerm aswell! jkingsman/Remote-Terminal-for-MeshCore#307 |
Summary
This updates flood-scope handling to match the firmware semantics for
SET_FLOOD_SCOPE.SET_FLOOD_SCOPEmode 0 with a 16-byte all-zero key is now treated as a null override rather than as an explicit request to send unscoped. This means it falls back to the configured default scope when one is present, matching firmware behavior.Explicit unscoped sending is now handled through mode 1 and remains sticky until a subsequent mode 0 set/reset. This matches the behavior used by Companion v12.
Changes
Testing
Full test suite passes locally: