libusb
libusb copied to clipboard
incorrect class name
Hi guys! I want to get a list of usb devices, Then catch my usb printer by it class So i did this
package main
import (
"fmt"
"github.com/gotmc/libusb/v2"
)
func main(){
c, err := libusb.NewContext();
if err != nil {
panic(err)
}
list, _:= c.DeviceList();
for _, device := range list {
d,_ := device.DeviceDescriptor()
fmt.Println(d.DeviceClass)
}
}
output:
Hub class.
Hub class.
Wireless class.
Each interface specifies its own class information and all interfaces operate independently.
its gives me Each interface specifies its own class information and all interfaces operate independently. instead of "printer" class!
in terminal i get:
❯ lsusb --verbose | grep "Printer"
iManufacturer 1 Printer-58
bInterfaceClass 7 Printer
bInterfaceSubClass 1 Printer
Why? and Thanks!