Repository navigation
Usb log tools - #3061
Merged
Merged
Usb log tools#3061
Conversation
Streams the firmware log to stdout and sends each line of stdin to the device shell, so it serves both as a log follower and as a console. --exit-on-idle makes it usable from scripts: send a command, collect its output, exit once the log goes quiet. The log comes from GetVariable/UsbVariable_ShellBuffer and commands go out as ExecShellCommand; all device access is serialised through the single poll loop, since stdin arrives asynchronously. Replaces an unreliable local log.sh, which polled UsbVariable_StatusBuffer (the macro status buffer) rather than the shell buffer. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N5oDHHomxRbhs7jTqA9rgW
Colour is kept when stdout is a terminal and stripped otherwise, overridable with --color/--no-color. Stripping carries an incomplete escape sequence across reads, since a sequence can straddle the 62-byte chunk boundary. Commands now carry their own trailing newline. ShellUartTransport_InjectInput only appends the submitting newline when the device's StripVt100 flag happens to be set, so without it the command is echoed but never executed; sending our own works in either mode. Verified against a UHK 80 right half over USB: log streaming, command execution and clean --exit-on-idle shutdown all work. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N5oDHHomxRbhs7jTqA9rgW
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.
Add a script to connect to uhk shell via usb.