我有一个通过 USB 连接的硬件设备,无需创建特定的 /dev/something。它确实改变了 /dev/ptmx 和 /dev/char 上的时间,但仅此而已。我所知道的是设备的 VID:PID,并且文档说 USB(应该)充当 921600 8N1 处的串行设备。如果我能够连接,我应该能够向它发送简单的文本命令 (SCSI),就像在串行接口上一样。
我很确定我可以使用 libusd 或 libhid 来连接它,但从头开始编写通信代码非常耗时。难道没有一些linux技巧来创建/dev/ttySomething,这样我就可以与minicom或简单的C程序进行通信吗?
$ dmesg
usb 1-2: new full-speed USB device number 7 using xhci_hcd
usb 1-2: New USB device found, idVendor=104d, idProduct=3001
usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-2: Product: ESP301 Motion Control
usb 1-2: Manufacturer: NEWPORT Corp.
usb 1-2: SerialNumber: 0000000000000000
$ lsusb -v
Bus 001 Device 007: ID 104d:3001 Newport Corporation
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 255 Vendor Specific Class
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x104d Newport Corporation
idProduct 0x3001
bcdDevice 1.01
iManufacturer 1 NEWPORT Corp.
iProduct 2 ESP301 Motion Control
iSerial 3 0000000000000000
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 2
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0002 1x 2 bytes
bInterval 1
Device Status: 0x0001
Self Powered