Skip to content

ShackSwitch: remove hardcoded callsign from device detection#2227

Merged
ten9876 merged 1 commit intoten9876:mainfrom
nigelfenton:fix/shackswitch-generic-detection
May 1, 2026
Merged

ShackSwitch: remove hardcoded callsign from device detection#2227
ten9876 merged 1 commit intoten9876:mainfrom
nigelfenton:fix/shackswitch-generic-detection

Conversation

@nigelfenton
Copy link
Copy Markdown
Contributor

Summary

  • Replaces all serial.startsWith("G0JKN") checks with the generic name.contains("ShackSwitch") that was already the second condition in every || expression
  • Changes the synthetic manual-IP serial from "G0JKN-manual""ShackSwitch-manual"
  • Updates all related comments and the CHANGELOG entry

Why

The G0JKN prefix is the author's personal callsign. The ShackSwitch firmware constructs its serial from the operator's callsign in config.json, so any other user's device would broadcast a different prefix and fail detection entirely. The device name field is always "ShackSwitch" (set from a firmware constant) and is the correct generic discriminator. No functional change for the original device.

Raised by Jeremy (KK7GWY) — thanks for the catch.

Files changed

File Change
AntennaGeniusModel.cpp 4× inline checks + static isShackSwitch()
ShackSwitchApplet.cpp 4× inline checks
ShackSwitchApplet.h Header comment
MainWindow.cpp Sentinel serial + comment
RadioSetupDialog.cpp Sentinel serial
AppletPanel.cpp Comment
CHANGELOG.md Entry updated

Test plan

  • Auto-connect via UDP discovery: ShackSwitch broadcasts name="ShackSwitch" — applet loads as before
  • Manual IP connect (SS_ManualIp): serial now "ShackSwitch-manual", name="ShackSwitch" still set alongside — detection still works
  • Real 4O3A AG device: name does not contain "ShackSwitch" — zero impact

🤖 Generated with Claude Code

Replace all `serial.startsWith("G0JKN")` checks with the generic
`name.contains("ShackSwitch")` check that was already the second
condition in every OR expression.  The serial prefix was the author's
personal callsign (G0JKN) — any other operator's ShackSwitch would
broadcast a different prefix and fail detection entirely.

The device name "ShackSwitch" is set by the firmware from a fixed
constant and is the same for all users, making it the correct and
sufficient discriminator.  No functional change for existing installs.

Also change the synthetic "G0JKN-manual" serial used for manual-IP
connections to "ShackSwitch-manual", and update all comments and the
CHANGELOG entry to reflect the new detection logic.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@ten9876 ten9876 merged commit 77b9572 into ten9876:main May 1, 2026
4 checks passed
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