fix(midi): restore TX/MOX toggle by reading isTransmitting() not isMox() (#3369). Principle I.#3371
Conversation
…x() (#3369). Principle I. The MIDI Toggle dispatch reads the getter, flips it, and calls the setter. For tx.mox and global.txButton the getter regressed to isMox() in #3221 (commit 6c37e37), silently reverting the fix from #2858 (407ae4c). Per FlexLib (Principle I), the radio never publishes `mox=` in `transmit status` messages, so m_mox stays false forever. The toggle then always reads 0, always flips to 1, always calls setTransmit(true) — stuck-on TX, mouse-only recovery. isTransmitting() reflects the optimistic state set inside TransmitModel::setMox() the moment setTransmit() fires, so the toggle correctly inverts on the next press. Matches the FlexControl handler already fixed by #2858. Fixes #3369. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Looks good — clean, minimal, correct fix. Thanks for picking this up.
The change aligns the MIDI getter with how every other TX-state observer in the codebase reads transmit state: the on-screen TX toggle (MainWindow.cpp:6734, :6932, :14964), the aetherial strip TX LED, the HID button bitmask (:6896), rigctl, and TCI all read isTransmitting(). The MIDI getters were the only outliers.
The root cause is consistent with the explanatory comment at MainWindow.cpp:12444: the radio doesn't reliably echo mox= in transmit status, so m_mox is stale. setTransmit() does, however, flip m_transmitting optimistically on the user's edge (RadioModel.cpp:1234), so isTransmitting() gives accurate LED feedback immediately on press — which is what a toggle controller needs.
Scope is tight (2 lines), no AppSettings/RAII concerns, nothing outside the stated scope.
🤖 aethersdr-agent · cost: $17.8262 · model: claude-opus-4-7
jensenpat
left a comment
There was a problem hiding this comment.
Reviewed independently: confirmed regression from #3221 (commit 6c37e37 reverted #2859's isTransmitting() getter back to isMox()). m_mox is never set from radio transmit status, so the MIDI toggle was stuck-on. Fix restores isTransmitting() — optimistically set in the setter path — matching every other TX observer in the codebase. Two-line scope, CI green. LGTM.
…x() (aethersdr#3369). Principle I. (aethersdr#3371) ## Summary Fixes aethersdr#3369 ### What was changed fix(midi): restore TX/MOX toggle by reading isTransmitting() not isMox() (aethersdr#3369). Principle I. ### Files modified - `src/gui/MainWindow.cpp` ``` src/gui/MainWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ``` --- Generated by AetherClaude (automated agent for AetherSDR) --- <sub>🤖 aethersdr-agent · cost: $3.1932 · model: claude-opus-4-7</sub> Co-authored-by: aethersdr-agent[bot] <273844287+aethersdr-agent[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Summary
Fixes #3369
What was changed
fix(midi): restore TX/MOX toggle by reading isTransmitting() not isMox() (#3369). Principle I.
Files modified
src/gui/MainWindow.cppGenerated by AetherClaude (automated agent for AetherSDR)
🤖 aethersdr-agent · cost: $3.1932 · model: claude-opus-4-7