Add LAN disconnect/reconnect UI and clean shutdown (#17)#34
Merged
adecarolis merged 2 commits intomasterfrom Apr 19, 2026
Merged
Add LAN disconnect/reconnect UI and clean shutdown (#17)#34adecarolis merged 2 commits intomasterfrom
adecarolis merged 2 commits intomasterfrom
Conversation
Resolves #17: a web-only UI to release the radio's LAN slot (so other apps like RS-BA1/wfview can use it) and ensures clean teardown sends the 0x05 disconnect packet when wfweb exits. Shutdown path: ~servermain() now calls icomCommander::closeComm() on each rig synchronously (BlockingQueuedConnection) before quit'ing the rig thread, so the udpHandlerThread finish -> udp deleteLater chain runs and ~icomUdpBase() gets to emit the 0x05 packet. closeComm() now also deletes its udpHandlerThread after wait() to avoid leaking QThread objects on reconnect, and commonSetup() uses UniqueConnection so a reconnect doesn't stack duplicate receiveCommand dispatches. UI: new Disconnect/Connect button on the power-off overlay, shown only when the connection type is LAN. When disconnected the overlay is forced visible (so the Connect button is reachable), the Power On button is hidden until reconnected, and the message flips to "Disconnected from radio". State flows via a new lanStatus WebSocket message plus isLan/lanConnected fields in /api/v1/radio/{info,status}. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
After a LAN disconnect/reconnect cycle, every CI-V response from the rig would log "Unsupported command received from rig" and UI commands would stop working within seconds of power-up. Two causes in the reconnect path of icomCommander: - commonSetup() cleared rigCaps.commands but left rigCaps.modelID set from the previous session. parseCommand() only calls determineRigCaps() when modelID == 0, so on reconnect the command map was never repopulated and incoming responses failed to match. - determineRigCaps() calls queue->setRigCaps(&rigCaps), but cachingQueue::setRigCaps is guarded by a pointer-equality check. Since the rigCaps instance is reused across reconnects, the signal rigCapsUpdated was suppressed — so servermain::receiveRigCaps never fired, AutoInformation stayed disabled and initPeriodicPolling() never ran. Reset modelID and haveRigCaps in commonSetup() so determineRigCaps() re-runs on the reconnect handshake, and clear the queue's rigCaps pointer in closeComm() so the subsequent setRigCaps(&rigCaps) actually re-emits rigCapsUpdated. Guard servermain::receiveRigCaps against the resulting nullptr emission. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lanStatusWebSocket message plusisLan/lanConnectedfields in/api/v1/radio/{info,status}.rigCapsunpopulated, causing "Unsupported command received from rig" spam and dead UI — resetsmodelID/haveRigCapsincommonSetup()and clears the queue'srigCapspointer incloseComm()sorigCapsUpdatedre-emits.Test plan
🤖 Generated with Claude Code