下面这个命令

lsusb -d VID:PID -v

可以看到设备的详细信息,其中 bDeviceClass 是设备类型,如果bDeviceClass为0,说明设备类型由接口层定义,可以看下面的 bInterfaceClass。
所以通过

lsusb -d VID:PID -v|grep bDeviceClass 
lsusb -d VID:PID -v|grep bInterfaceClass

综合判断可以获取USB设备类型。

具体USB设备类型可以看下面这个网站:
https://www.usb.org/defined-class-codes

BaseClassDescriptor UsageDescription
00hDeviceUse class information in the Interface Descriptors
01hInterfaceAudio
02hBothCommunications and CDC Control
03hInterfaceHID (Human Interface Device)
05hInterfacePhysical
06hInterfaceImage
07hInterfacePrinter
08hInterfaceMass Storage
09hDeviceHub
0AhInterfaceCDC-Data
0BhInterfaceSmart Card
0DhInterfaceContent Security
0EhInterfaceVideo
0FhInterfacePersonal Healthcare
10hInterfaceAudio/Video Devices
11hDeviceBillboard Device Class
12hInterfaceUSB Type-C Bridge Class
DChBothDiagnostic Device
E0hInterfaceWireless Controller
EFhBothMiscellaneous
FEhInterfaceApplication Specific
FFhBothVendor Specific

标签: none

添加新评论