Skip to content

TCP API: 8 STATION commands + headless autoreply confirmation#207

Merged
wmiler merged 3 commits into
JS8Call-improved:masterfrom
BrunoKlu:pr/tcp-mode-commands
Mar 7, 2026
Merged

TCP API: 8 STATION commands + headless autoreply confirmation#207
wmiler merged 3 commits into
JS8Call-improved:masterfrom
BrunoKlu:pr/tcp-mode-commands

Conversation

@BrunoKlu

@BrunoKlu BrunoKlu commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds 8 new MODE TCP commands for remote configuration and replaces the blocking SelfDestructMessageBox autoreply confirmation with a TCP push mechanism, making JS8Call fully controllable in headless (xvfb) environments.

New TCP commands

Command Description
MODE.GET_CONFIG Returns all mode/config states (auto_reply, js8hb, hback, multi_decoder, hb_interval, speed, autoreply_confirmation)
MODE.SET_AUTO_REPLY Toggle auto-reply on/off
MODE.SET_JS8HB Toggle JS8 heartbeat on/off
MODE.SET_HBACK Toggle heartbeat acknowledgment on/off
MODE.SET_MULTI_DECODER Toggle multi-decoder on/off
MODE.SET_HB_INTERVAL Set heartbeat interval (seconds)
MODE.SET_HB_TIMER Start/stop the heartbeat timer
MODE.SEND_HB Send a heartbeat immediately

Headless autoreply confirmation

confirmThenEnqueueMessage() now sends an AUTOREPLY.CONFIRM TCP push with the pending message details, and waits for an AUTOREPLY.CONFIRM_RESPONSE TCP command (accept/reject). This replaces SelfDestructMessageBox which blocks the Qt event loop under xvfb.

Changes

File Change
JS8_Mainwindow/networkMessage.cpp 8 new MODE command handlers (+131 lines)
JS8_UI/mainwindow.cpp TCP-based confirmation replaces MessageBox
JS8_UI/mainwindow.h PendingConfirmation struct + map
JS8_UI/Configuration.cpp autoreply_confirmation() accessor
JS8_UI/Configuration.h Declaration

183 insertions, 19 deletions across 5 files.

Motivation

When running JS8Call headless via xvfb-run (e.g. on a Raspberry Pi), there is no way to change mode settings or respond to autoreply confirmations — the Settings dialog and MessageBox require a display. These TCP commands enable remote/web interfaces to fully control JS8Call without VNC.

Testing

  • Tested on Raspberry Pi 5 running JS8Call 2.5.2 headless via xvfb-run
  • All 8 MODE commands verified: settings persist in INI, TCP responses correct
  • Autoreply confirmation: TCP push received, accept/reject via TCP works, timeout fallback intact

- networkMessage.cpp: MODE.GET_CONFIG, SET_AUTO_REPLY, SET_JS8HB,
  SET_HBACK, SET_MULTI_DECODER, SET_HB_INTERVAL, SET_HB_TIMER, SEND_HB
- mainwindow.cpp/h: confirmThenEnqueueMessage() sends TCP push
  instead of SelfDestructMessageBox (headless/xvfb compatible)
- Configuration.cpp/h: autoreply_confirmation accessor

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread JS8_Mainwindow/networkMessage.cpp
Comment thread JS8_UI/mainwindow.cpp Outdated
Comment thread JS8_UI/mainwindow.cpp Outdated
- Rename 10 new config commands from MODE.* to STATION.* (MODE is
  reserved for JS8 protocol only, STATION is for configuration)
- Add @note API 2.6+ to each new @brief block
- Translate French comments to English

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
BrunoKlu added a commit to BrunoKlu/JS8Call-improved that referenced this pull request Mar 2, 2026
Applique les memes corrections que PRs JS8Call-improved#207/JS8Call-improved#208/JS8Call-improved#209 sur la branche
qmx-pi : MODE.* → STATION.* pour les commandes config, FILTER.* → RX.*
pour les commandes filtre, @note API 2.6+ sur tous les @brief, et
traduction commentaires francais → anglais.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@BrunoKlu BrunoKlu requested a review from wmiler March 2, 2026 21:34
@wmiler

wmiler commented Mar 3, 2026

Copy link
Copy Markdown
Collaborator

Ok, looks pretty good. I'm going to make you do one more thing, it's just a cut'n'paste tho, so not much. :)
If you would move all your STATION code up in the file to just before the /** @} */ // End STATION Commands on line 299 in networkMessage.cpp that would help Doxygen a ton. And then I think this will be ready to go.

@wmiler wmiler added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 3, 2026
@wmiler wmiler linked an issue Mar 3, 2026 that may be closed by this pull request
@wmiler wmiler removed a link to an issue Mar 3, 2026
@wmiler wmiler mentioned this pull request Mar 3, 2026
@wmiler wmiler added this to the 2.6.0 milestone Mar 4, 2026
@wmiler wmiler added the API label Mar 4, 2026
@wmiler

wmiler commented Mar 5, 2026

Copy link
Copy Markdown
Collaborator

@BrunoKlu Haven't seen an update yet. If you could get to this soon, it would be appreciated. This is blocking your other PRs, and I have another PR from somebody else that is right behind yours. Thanks.

@wmiler wmiler changed the title TCP API: 8 MODE commands + headless autoreply confirmation TCP API: 8 STATION commands + headless autoreply confirmation Mar 6, 2026
@BrunoKlu

BrunoKlu commented Mar 6, 2026

Copy link
Copy Markdown
Contributor Author

Will do that tomorrow !

Move all STATION.* command handlers (GET_CONFIG, SET_AUTO_REPLY,
SET_JS8HB, SET_HBACK, SET_MULTI_DECODER, SET_HB_INTERVAL,
SET_HB_TIMER, SEND_HB, SET_AUTOREPLY_CONFIRMATION,
AUTOREPLY_CONFIRM_RESPONSE) from the MODE section to the STATION
section, just before the End STATION Commands marker.
Update summary comment block with new command list.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wmiler wmiler merged commit cede1cb into JS8Call-improved:master Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants