fix(cdc-acm): don't warn when serial console gadget is disabled - #1524
Open
ilyongnoh-ux wants to merge 1 commit into
Open
fix(cdc-acm): don't warn when serial console gadget is disabled#1524ilyongnoh-ux wants to merge 1 commit into
ilyongnoh-ux wants to merge 1 commit into
Conversation
The CDC-ACM data channel opens /dev/ttyGS0 in its OnOpen handler. When the serial console USB gadget is disabled (the default), that device node does not exist, so every channel open logged a Warn about failing to open the device. Check config.UsbDevices.SerialConsole first: when the console gadget is not enabled, log a single Debug line and close the channel instead of attempting the open and warning. The existing Warn is kept for the case where the gadget is enabled but the open genuinely fails. Co-Authored-By: Claude Fable 5 <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.
What
When the USB serial console gadget is disabled (the default config), /dev/ttyGS0 does not exist, but every CDC-ACM data channel open logs a warning:
This repeats on every client session and fills the log with noise for a configuration that is working as intended.
How
handleCDCACMChannelnow checksconfig.UsbDevices.SerialConsolebefore trying to open the device. If the gadget is disabled it logs a single Debug line and closes the channel. The Warn path is preserved for the genuine failure case (gadget enabled but the device could not be opened).Testing
Built with the buildkit toolchain and deployed on a JetKVM (v2, system 0.2.8) running a 0.5.8-based build: with the serial console disabled, the warning no longer appears across multiple client sessions.
🤖 Generated with Claude Code