Skip to content

Spot trigger — include pan= so external CAT clients can route the spot (#2366)#2369

Merged
ten9876 merged 1 commit intomainfrom
fix/spot-trigger-pan-2366
May 5, 2026
Merged

Spot trigger — include pan= so external CAT clients can route the spot (#2366)#2369
ten9876 merged 1 commit intomainfrom
fix/spot-trigger-pan-2366

Conversation

@aethersdr-agent
Copy link
Copy Markdown
Contributor

Summary

Fixes #2366 — clicking a panadapter spot in AetherSDR was sending spot trigger N to the radio without the pan= parameter, so the radio broadcast spot N triggered pan=0x00000000. Multi-pan-aware CAT clients such as SDC Contest (UT4LW) rely on that pan handle to route the spotted callsign to the correct QSO entry window — without it, the callsign never appears.

Change

One-line fix in src/gui/MainWindow.cppwirePanadapter() already captures applet in the spotTriggered lambda's closure, and applet->panId() returns the pan stream ID as a "0x..."-formatted string (see PanadapterApplet.h:27). We just include it in the outbound command:

m_radioModel.sendCommand(
    QString("spot trigger %1 pan=%2").arg(spotIndex).arg(applet->panId()));

This matches FlexLib's Spot.Trigger(Panadapter pan) overload (FlexLib/Spot.cs:352-377), which is what SmartSDR uses on click. Our inbound parser at RadioModel.cpp:3223-3242 already reads the pan= field off the broadcast — only the outbound command was missing it.

Scope notes

  • This is the only spot trigger command emitter in the codebase.
  • The Memory / passive-local-spot branches above the changed line are AetherSDR-only and don't go to the radio, so they're unaffected.
  • No protocol/firmware change required — purely client-side.
  • Risk is essentially zero: single-pan setups currently get 0x00000000 filled in by the radio, and any sane downstream falls back to the active pan; adding the explicit handle only ever adds information. Multi-pan setups (the case Yuri reported) gain correct routing.

Test plan

  • Build clean and confirm no warnings around the modified call site.
  • With a single pan, click a spot → radio broadcast contains the active pan handle (e.g. pan=0x40000000) instead of 0x00000000.
  • With two pans, click a spot on the secondary pan → broadcast carries the secondary pan's handle, and SDC Contest routes the callsign to the right QSO window.
  • Memory-source spots and passive local spots still skip the radio command (unchanged behavior).

🤖 Generated with Claude Code

#2366)

Without the pan handle the radio broadcasts spot N triggered pan=0x00000000,
which leaves multi-pan-aware clients (e.g. SDC Contest) unable to route the
spotted callsign to the right QSO entry window. applet->panId() is already
in scope at the click site and is "0x..."-formatted.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
Copy link
Copy Markdown
Contributor Author

@aethersdr-agent aethersdr-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good — verified the claims against the tree:

  • PanadapterApplet::panId() (PanadapterApplet.h:27) returns the "0x..." handle as a QString, which is what arg() will substitute directly. No format conversion needed.
  • The lambda at MainWindow.cpp:9026 already captures applet from wirePanadapter's argument, so no closure changes were required.
  • The inbound side at RadioModel.cpp:3294-3308 already parses pan= off spot N triggered ... broadcasts (regex pan=(0x[0-9A-Fa-f]+)), so this just symmetrically populates what we already read.
  • Confirmed via grep that this is the only outbound spot trigger emitter, and the Memory + passive-local branches above the changed line short-circuit before the radio command, as the PR description states.

Scoped to a single file, single line, no behavioral side effects in the no-pan-handle case (the radio fills in 0x00000000 for empty pan=, same as today's omission). Thanks for the careful writeup linking the FlexLib Spot.Trigger(Panadapter) overload and the SDC Contest report — made this easy to verify.

@ten9876 ten9876 merged commit 9ee8688 into main May 5, 2026
5 checks passed
@ten9876 ten9876 deleted the fix/spot-trigger-pan-2366 branch May 5, 2026 06:20
@ten9876
Copy link
Copy Markdown
Owner

ten9876 commented May 5, 2026

Claude here on Jeremy's behalf — merged via admin squash. Stale-code audit clean, single-emitter confirmed, FlexLib reference grounding the fix. SDC Contest routing should now work for Yuri (UT4LW) and any other multi-pan-aware CAT client.

73, Jeremy KK7GWY & Claude (AI dev partner)

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.

spot trigger command missing pan= parameter — click-to-spot broken for external CAT clients (SDC)

2 participants