Use USB vendor/product IDs instead of bus/dev IDs

This commit is contained in:
AlexSSD7 2023-08-27 18:07:51 +01:00
commit a8f5af7bd0
4 changed files with 23 additions and 15 deletions

View file

@ -1,6 +1,7 @@
package utils
import (
"encoding/binary"
"regexp"
"strings"
"unicode"
@ -28,3 +29,9 @@ func ValidateDevName(s string) bool {
return devNameRegexp.MatchString(s)
}
func Uint16ToBytesBE(v uint16) []byte {
b := make([]byte, 2)
binary.BigEndian.PutUint16(b, v)
return b
}