Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cdc_acm_console.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ func handleCDCACMChannel(d *webrtc.DataChannel) {

var f *os.File
d.OnOpen(func() {
// When the serial console gadget is disabled (the default), /dev/ttyGS0
// does not exist. Skip quietly instead of warning on every channel open.
if config == nil || config.UsbDevices == nil || !config.UsbDevices.SerialConsole {
scopedLogger.Debug().Msg("CDC-ACM console is not enabled in USB device configuration")
d.Close()
return
}

var err error
f, err = os.OpenFile(cdcACMDevicePath, os.O_RDWR, 0)
if err != nil {
Expand Down
Loading