use a cross-platform lib to fetch the available ports for probing

This commit is contained in:
2026-05-26 11:38:48 +01:00
parent 8b02b427bc
commit 1cb1d64ebe
+3 -3
View File
@@ -4,19 +4,19 @@ import (
"esdi/peripheral/communication"
"esdi/peripheral/communication/packets"
"fmt"
"path/filepath"
"time"
"github.com/tarm/serial"
portp "go.bug.st/serial"
)
func listPorts() ([]string, error) {
ttyUSBs, err := filepath.Glob("/dev/ttyUSB*")
ports, err := portp.GetPortsList()
if err != nil {
return []string{}, err
}
return ttyUSBs, nil
return ports, nil
}
func probe(WT *communication.WalkieTalkie) error {