Skip to content

feat(cli): add input injection and file access commands for debug builds - #7873

Merged
pfeerick merged 2 commits into
mainfrom
3djc/cli-input-injection
Oct 6, 2026
Merged

pfeerick merged 2 commits into
mainfrom
3djc/cli-input-injection

Conversation

@3djc

@3djc 3djc commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Add debug-only CLI commands so a running radio can be driven and inspected from tools (pair with a framebuffer grab via jlink):

Input injection (CLI_INPUT_INJECT):

key <label> [ms]
trim <label><+|-> [ms]
touch <x> <y> [ms] [x2 y2]
rotary <steps>

SD card file access (CLI_FILE_ACCESS):

lsl <dir>                      "<d|f> <size> <name>" per entry
fread <path> <offset> <len>    one line of hex (keep len <= 1 KB, see below)
fput <path> <offset> <len>     <len> raw bytes follow the command line, up to 4 KB; offset 0 truncates
fwrite <path> <offset> [hex]   small hex writes, offset 0 truncates
rm <path>
mkdir <path>

Both are behind CLI && DEBUG && !BOOT, so non-debug builds are unchanged. In debug builds the CLI RX buffer grows from 256 B to ~4 KB to hold an fput block.

Tested on a TX16S MK3: random binary files of 100 B to 200 KB round-trip exactly, about 220 KB/s write and 28 KB/s read.

Known limit: the USB CDC TX ring (usbd_cdc.cpp) duplicates bytes when a single reply is roughly 2 KB or more, so fread replies should stay at or below 1 KB. This is not changed here.

It helps me on my local dev where I'm creating a setup allowing AI to check the result of its work on a real radio :)

🤖 Generated with Claude Code

Add CLI commands that inject input on a running radio so UI changes can
be checked on hardware (pair with a framebuffer grab):

  key <label> [ms]
  trim <label><+|-> [ms]
  touch <x> <y> [ms] [x2 y2]
  rotary <steps>

Everything is behind CLI_INPUT_INJECT (CLI && DEBUG && !BOOT), so
non-debug builds are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@pfeerick

pfeerick commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Would this replace #7668 (which claims to itself replace #7337)

@3djc

3djc commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

Not the same scope is it ? This is to use real radio, not simu

@pfeerick

pfeerick commented Oct 6, 2026

Copy link
Copy Markdown
Member

sorry, missed that, ok, so input to live radio... nice!

@pfeerick

pfeerick commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

All that is really missing is you need to be able to make it to send back screen captures, then it can actually properly start the drive the radio itself. Nice to finally see some work towards that goal we talked about this time last year of automatable testing 😆

Add lsl, fread, fwrite, fput, rm and mkdir behind CLI_FILE_ACCESS
(CLI && DEBUG && !BOOT), so tools can read and write the SD card over
the USB VCP. fput takes raw bytes after the command line (up to 4 KB,
offset 0 truncates); fread replies in hex.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@3djc 3djc changed the title feat(cli): key, trim, touch and rotary input injection (debug builds) feat(cli): input injection and file access commands (debug builds) Oct 6, 2026
@pfeerick pfeerick changed the title feat(cli): input injection and file access commands (debug builds) feat(cli): add input injection and file access commands for debug builds Oct 6, 2026
@pfeerick pfeerick added the debug label Oct 6, 2026
@pfeerick pfeerick added this to the 3.0 milestone Oct 6, 2026
@pfeerick
pfeerick merged commit 1b031cc into main Oct 6, 2026
39 checks passed
@pfeerick
pfeerick deleted the 3djc/cli-input-injection branch October 6, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants