Skip to content

Cut the default flood scope's name at its first NUL - #128

Merged
fdlamotte merged 1 commit into
meshcore-dev:mainfrom
hamsolodev:default-flood-scope-nul
Nov 22, 2026
Merged

fdlamotte merged 1 commit into
meshcore-dev:mainfrom
hamsolodev:default-flood-scope-nul

Conversation

@hamsolodev

Copy link
Copy Markdown
Contributor

What was wrong (#119, A4): DEFAULT_FLOOD_SCOPE's name was read with .decode(...).replace("\0", ""). Companion v1.18.0's set strcpys the new name over the stored one (MyMesh.cpp:1993), and its get sends all 31 bytes (MyMesh.cpp:2009). So after setting #au-vic-gipps and then #au, the field holds #au\0vic-gipps, and meshcore reported #auvic-gipps. The firmware side is reported as meshcore-dev/MeshCore#3891.

What changed: the name is cut at its first NUL before decoding.

Verified

  • A unit test next to the existing DEFAULT_FLOOD_SCOPE ones fails on current main.
  • The whole suite passes on 3.11 and 3.14.
  • Against companion v1.18.0, built for the host and run under MeshBench: set #au-vic-gipps, set #au, get.
sent     3f 2361752d7669632d6769707073 00… <key>
answered 00
sent     3f 23617500… <key>
answered 00
sent     40
answered 1c 236175 00 7669632d6769707073 00… f7749b8eaab70ec2617282f0610cd167

Current main reports scope_name '#auvic-gipps' from that frame; this branch reports '#au'.

Part of #119.

Companion v1.18.0 strcpy's a new default scope name over the stored one
and sends all 31 bytes back, so after "#au-vic-gipps" then "#au" the field
is "#au\0vic-gipps". Removing the NULs joined the two into "#auvic-gipps".

Part of meshcore-dev#119 (A4).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants