Значит так, все по порядку.
В качестве хоста имеем: процессор AR9331 c с подключенным к нему USB-хабом на 4 входа от TI (TUSB2044). На хосте установлена OpenWRT с поддержкой LIBUSB (на ней и пишется управление устройствами USB).
С другой стороны - вольтметр В7-78/1 с USB управлением с поддержкой SCPI (текстовый протокол).
При подключении к хабу устройство уверенно появляется в списке (наше устройство - 164e:0dad):
Код
Bus 001 Device 002: ID 0451:2046 Texas Instruments, Inc. TUSB2046 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 164e:0dad
Bus 001 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 164e:0dad
Bus 001 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
У устройства - один интерфейс и 3 end-point:
Код
root@BlackSwift:/new_project# lsusb -s 001:005 -v
Bus 001 Device 005: ID 164e:0dad
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 16
idVendor 0x164e
idProduct 0x0dad
bcdDevice 1.00
iManufacturer 2 PICOTEST CORP
iProduct 3 Voltmeter V7-78/1
iSerial 1 TW00024605
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x60
(Missing must-be-set bit!)
Self Powered
Remote Wakeup
MaxPower 2mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 254 Application Specific Interface
bInterfaceSubClass 3 Test and Measurement
bInterfaceProtocol 1 TMC
iInterface 4 (error)
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0010 1x 16 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Device Status: 0x0001
Self Powered
Bus 001 Device 005: ID 164e:0dad
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 16
idVendor 0x164e
idProduct 0x0dad
bcdDevice 1.00
iManufacturer 2 PICOTEST CORP
iProduct 3 Voltmeter V7-78/1
iSerial 1 TW00024605
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x60
(Missing must-be-set bit!)
Self Powered
Remote Wakeup
MaxPower 2mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 254 Application Specific Interface
bInterfaceSubClass 3 Test and Measurement
bInterfaceProtocol 1 TMC
iInterface 4 (error)
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0010 1x 16 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Device Status: 0x0001
Self Powered
Далее - привожу последовательность (условную, ибо команды разбросаны по классу управления) открытия устройства:
libusb_init
libusb_set_debug
libusb_get_device_list/libusb_open_device_with_vid_pid
libusb_set_configuration - добавлено от безысходности в поиске проблем
libusb_claim_interface / 0
в качестве подтверждения, что устройство открыто - еще пара команд от безысходности
libusb_get_string_descriptor_ascii (dev, 2, manufacturer, 256);
libusb_get_string_descriptor_ascii (dev, 3, product, 256);
Ну и под конец
libusb_bulk_transfer (dev, snd_t->endpoint, buff, buff_size, &actual, 10000); // endpoint - 0x02
Команды передавались разные
SYSTEM:BEEPER\n
READ?\n
DISPLAY:TEXT \'ABCD\'\n
В качестве buff_size использовалась длина команды, длина буфера bulk (64), снова - длина команды с добавлением еще одного libusb_bulk_transfer с длиной 0.
Все команды (в том числе - и libusb_bulk_transfer) заканчивались без ошибок. Actual содержала правильное количество переданных байт.
Но! Никакой реакции со стороны вольтметра.. Увы.
Возможно - надо как-то что-то предварительно конфигурировать. чтобы вольтметр услышал мой голос

В расстерянности и с уважением...