Added doc for new USB Product field (windows-only)

This commit is contained in:
Cristian Maglie
2020-04-18 22:22:31 +01:00
parent f0d91f6e0d
commit 820cffa341
2 changed files with 15 additions and 6 deletions

View File

@@ -15,9 +15,12 @@
//
package main
import "fmt"
import "log"
import "go.bug.st/serial/enumerator"
import (
"fmt"
"log"
"go.bug.st/serial/enumerator"
)
func main() {
ports, err := enumerator.GetDetailedPortsList()
@@ -29,9 +32,12 @@ func main() {
}
for _, port := range ports {
fmt.Printf("Port: %s\n", port.Name)
if port.Product != "" {
fmt.Printf(" Product Name: %s\n", port.Product)
}
if port.IsUSB {
fmt.Printf(" USB ID %s:%s\n", port.VID, port.PID)
fmt.Printf(" USB serial %s\n", port.SerialNumber)
fmt.Printf(" USB ID : %s:%s\n", port.VID, port.PID)
fmt.Printf(" USB serial : %s\n", port.SerialNumber)
}
}
}