Skip to content

Commit

Permalink
Merge pull request #5 from johnmccabe/BUGFIX/compare-vid-pid-osx
Browse files Browse the repository at this point in the history
Case insensitive port PID and VID lookup
  • Loading branch information
johnmccabe authored Apr 14, 2023
2 parents a74d801 + 6d41cdf commit cfb085b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mote.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"fmt"
"io"
"log"
"strings"

"go.bug.st/serial"
"go.bug.st/serial/enumerator"
Expand Down Expand Up @@ -236,7 +237,7 @@ func findSerialPort(v, p string) *string {
return nil
}
for _, port := range ports {
if port.VID == v && port.PID == p {
if strings.EqualFold(port.VID, v) && strings.EqualFold(port.PID, p) {
log.Printf("found Mote connected to port: %s\n", port.Name)
return &port.Name
}
Expand Down

0 comments on commit cfb085b

Please sign in to comment.