From 0fcae878ac18423f5e3748b7d56436c326f115f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Vy=C5=A1niauskas?= Date: Wed, 4 Mar 2026 10:21:39 +0200 Subject: [PATCH 1/2] Fix: avoid flooding logs with error messages about non-USB serial devices On a PlayOS PC, the logs are now filled with: level=error msg="Failed to convert serial port details to device info!" err="strconv.ParseUint: parsing \"\": invalid syntax" package=flex.enumerator port="&{/dev/ttyS0 false }" level=error msg="Failed to convert serial port details to device info!" err="strconv.ParseUint: parsing \"\": invalid syntax" package=flex.enumerator port="&{/dev/ttyS1 false }" this is because the go-serial enumerator returns empty values for non-USB serial port details. Since there is no way to distinguish between a USB and non-USB serial device, we rely on a rather silly check that all the USB descriptor fields are non-empty. --- src/dividat-driver/flex/enumerator/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/dividat-driver/flex/enumerator/main.go b/src/dividat-driver/flex/enumerator/main.go index 439bfdf..66f94c1 100644 --- a/src/dividat-driver/flex/enumerator/main.go +++ b/src/dividat-driver/flex/enumerator/main.go @@ -90,6 +90,11 @@ func (handle *DeviceEnumerator) ListMatchingDevices() []MatchedDevice { for _, port := range ports { handle.log.WithField("name", port.Name).WithField("vendor", port.VID).Debug("Considering serial port.") + if (port.VID == "") || (port.PID == "") || (port.BcdDevice == "") { + handle.log.WithField("name", port.Name).Debug("Skipping serial port due to missing USB descriptors (not a USB device?)") + continue + } + device, err := portDetailsToDeviceInfo(*port) if err != nil { handle.log.WithField("port", port).WithField("err", err).Error("Failed to convert serial port details to device info!") From ad1135ce4eb103e6a1b0f02d90c0bbc58a9db2a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Vy=C5=A1niauskas?= Date: Wed, 4 Mar 2026 10:29:46 +0200 Subject: [PATCH 2/2] Add Changelog entry --- Changelog.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Changelog.md b/Changelog.md index 3705dae..654e731 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,10 @@ ## [UNRELEASED] +### Changed + +- Do not produce error logs when encountering non-USB serial devices + ## [2.8.0] - 2026-02-17 ### Added