Skip to content

dm32: correct scan-list 15-member notes (retract terminator theory) - #16

Open
emuehlstein wants to merge 1 commit into
mainfrom
fix/scanlist-terminator-theory
Open

dm32: correct scan-list 15-member notes (retract terminator theory)#16
emuehlstein wants to merge 1 commit into
mainfrom
fix/scanlist-terminator-theory

Conversation

@emuehlstein

Copy link
Copy Markdown
Contributor

The notes field in radios/baofeng_dm32/capabilities.json carried a
theory that is wrong, and it is the kind of wrong that generates bad
advice: it told a reader that a full 15-member scan list is dangerous
and implied dropping the largest list to 14.

What was wrong

Exceeding 15 is silently destructive: NeonPlug clamps to Math.min(len, 15)
but only writes the 0x0000 terminator when channelCount < 15, so a full
15-member list emits no terminator and the radio parses past the end of the
record into the adjacent field, which makes every scan list unselectable
rather than just the oversized one.

The terminator observation about NeonPlug is real, but the conclusion
drawn from it is not. The guard was never load-bearing: the 57-byte
record buffer is fill(0x00), and the +0x38 padding already terminates
a full list. Lists at exactly 15 are fine and are in active use
(AirBand, FAMILY, HAM, MARINE).

What is actually going on

Hardware-verified 2026-08-07 on a DP570UV: +0x0F is not a member
slot.
OEM CPS moves the first grid member there on write, and that
channel is neither scanned nor displayed. CPS counts it, which is why
lists read count = list + 1.

That also supersedes the other half of the old note. The CPS appears to
offer 16 because it counts this phantom +0x0F entry — not because of a
Current Channel entry registered at index 0. Both explanations pointed
at the same symptom; only one of them is the mechanism.

Practical guidance now recorded: leave +0x0F zero, +0x1A is the
entire membership, and the +0x0B count byte is unreliable.

Also recorded

The related decode bug corrected in upstream PR #156: scan-list ID is
0x19 & 0x3F (low 6 bits), not bits 5-2. The old mask cannot address
past list 15.

Scope

Notes text only. No limits changedmax_channels_per_scan_list
stays 15, and the cap itself was never in question. 30 tests pass.

Refs #3.

The notes field claimed a full 15-member scan list emits no 0x0000
terminator and makes every scan list unselectable, and implied dropping
the largest list to 14. That theory is wrong and was retracted after
hardware verification on 2026-08-07 (DP570UV).

The 57-byte record buffer is fill(0x00) and the +0x38 padding already
terminates a full list, so the terminator guard was never load-bearing.
Lists at exactly 15 are fine and are in active use (AirBand, FAMILY,
HAM, MARINE).

The real cause is that +0x0F is not a member slot: OEM CPS moves the
first grid member there on write and that channel is neither scanned
nor displayed. CPS counts it, which is why lists read count = list + 1
and why the CPS appears to offer 16. This also replaces the previous
'Current Channel at index 0' explanation for the CPS 16.

Also records the related decode bug from upstream PR #156: scan-list ID
is 0x19 & 0x3F, not bits 5-2.

No limits changed; max_channels_per_scan_list stays 15.
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.

1 participant