Send 'Sequence completed in N ms' message at trial end#1
Open
mbreiser wants to merge 1 commit into
Open
Conversation
The maDisplayTools host wrapper PanelsController.trialParams() with waitForEnd=true expects to match this exact message text after the trial finishes. The previous empty-string response caused the host to time out and return false even when the trial ran successfully. Affects PLAYING_PATTERN and ANALOG_CLOSED_LOOP end-of-trial paths. 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
waitForEnd=truewaits for an end-of-trial response whose payload matches\"Sequence completed in N ms\". The previous empty-string response caused that path to time out and returnfalseeven when the trial ran successfully.serviceDisplay()(PLAYING_PATTERN and ANALOG_CLOSED_LOOP), using a 40-byte stack buffer andsnprintf.runtime_duration_ms_isuint32_t(CommandProcessor.h:51); cast tounsigned longfor%luportability.Why
On a fresh bring-up of a 2×12 arena from macOS using
maDisplayToolsexamples/oldButFunctional/G41_Modes_Demo.m, both mode 2 and mode 3 trials played correctly on the panels buttrialParams()returnedfalse. Tracing showed the host'sexpectResponseinner call (PanelsController.m:631) waiting up todeciSec/10 + 1seconds for the formatted completion string and never matching against the empty payload.Compatibility
CommandExecutorexperiment-runner path usestrialParams(..., waitForEnd=false), which only consumes the immediate ACK and never reads the end-of-trial message (CommandExecutor.m:139,153,168). That path is unchanged by this PR — we still send a TRIAL_PARAMS_CMD response, just with non-empty payload.snprintfis already used in NetworkManager.cpp:24,28.Test plan
pio run -e teensy41-printf -t upload, uploaded to a Teensy 4.1 connected to a 2×12 arena, ranexamples/oldButFunctional/G41_Modes_Demo.mmode 2 and mode 3 against IP 10.102.40.124.Result: truereturns within the expected duration.expectResponseconsumer is sensitive to the longer payload size (29-byte string + 3-byte header = 32 bytes vs 3 bytes previously).🤖 Generated with Claude Code