Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect class name #16

Open
zakaria-chahboun opened this issue Jul 3, 2022 · 0 comments
Open

incorrect class name #16

zakaria-chahboun opened this issue Jul 3, 2022 · 0 comments

Comments

@zakaria-chahboun
Copy link

zakaria-chahboun commented Jul 3, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant