fix(protocol): respect M-message severity so Info notices don't pop modals#2785
Merged
Conversation
…odals PR #2771 surfaced M-prefix radio messages as user-facing dialogs but treated every message as a warning. In practice the radio sends an Info-severity M-message on every client connect ("Client connected from IP …") — a routine multi-client notice that SmartSDR silently logs. AetherSDR was popping a modal warning dialog on every connect as a result. FlexLib's wire format (Radio.cs:4498-4516) encodes severity in bits 24-25 of the message number: M<8-hex-digits>|<text> └── (num >> 24) & 0x3 → Info=0, Warning=1, Error=2, Fatal=3 CommandParser was extracting the handle as a single hex value but discarding the severity bits. This change pulls them out into a new MessageSeverity enum field on ParsedMessage, threads them through the radioMessageReceived signal, and switches on them in MainWindow: Info → statusBar()->showMessage(text, 5000) (5-second toast) Warning → QMessageBox::warning (PR #2771's intent — preserved) Error → QMessageBox::critical with "Radio — Error" title Fatal → QMessageBox::critical with "Radio — Fatal" title The protocol-channel logging in RadioModel::onMessageReceived also switches on the same enum (qCInfo / qCWarning / qCCritical) so the diagnostic level matches the user-facing surfacing. Both paths use the SAME enum so they can't disagree. Behavior changes: * "Client connected from IP …" → status-bar toast (was modal popup) * "Client disconnected from IP …" → status-bar toast (was modal popup) * FreeDV mode-conflict warning from #2771 — unchanged, still modal * Future ATU/interlock/calibration errors — modal with Error/Fatal title prefix Tested locally: connect to FLEX-8400 → IP notice appears in status bar for 5 seconds, no modal dialog interrupts the connection flow. Files: src/core/CommandParser.h — MessageSeverity enum + ParsedMessage field + protocol comment update src/core/CommandParser.cpp — extract severity bits in the 'M' case src/models/RadioModel.h — signal signature + comment src/models/RadioModel.cpp — switch on severity for protocol log level; emit with severity src/gui/MainWindow.h — slot signature + CommandParser include src/gui/MainWindow.cpp — switch on severity for log + dialog Co-Authored-By: Claude Opus 4.7 (1M context) <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
PR #2771 (merged today) added user-facing dialogs for M-prefix radio messages. In practice the radio sends an Info-severity M-message on every client connect/disconnect ("Client connected from IP …" etc.) — routine multi-client notices that SmartSDR silently logs. AetherSDR was popping a modal warning dialog on every connect as a result.
The fix extracts the severity bits that FlexLib documents but AetherSDR's parser was discarding, then surfaces messages appropriately by severity.
Root cause
FlexLib's wire format (Radio.cs:4498-4516) encodes severity in bits 24-25 of the M-message number:
```
M<8-hex-digits>|
└── (num >> 24) & 0x3 → Info=0, Warning=1, Error=2, Fatal=3
```
AetherSDR's `CommandParser` was extracting the handle as a single hex value but discarding the severity bits. PR #2771's MainWindow handler then treated all M-messages identically as `QMessageBox::warning`.
What changes
Behavior changes
Test plan
Files
Net: 83 insertions / 16 deletions across 6 files.
🤖 Generated with Claude Code