4

I am trying to implement data exchange with some HID device. I managed to implement reading from this device using libusb_interrupt_transfer function, but I do not know how to implement sending a buffer to the HID, because device has not OUT endpoint. How can I transfer data to HID? Descriptor of device looks like this:

Bus 001 Device 074: ID 16d0:8080 MCS 
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x16d0 MCS
  idProduct          0x8080 
  bcdDevice            2.03
  iManufacturer           1 
  iProduct                2 
  iSerial                 3 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      32
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               5
Nina
  • 65
  • 1
  • 6

1 Answers1

0

If the device doesn't have an OUT endpoint, the only way to send data to the device is using control transfers using default control endpoint (EP0).

There are HID class specific control requests mentioned in the HID Specification document. However, SET_* requests aren't mandatory, so your HID device may not support them.

There can be also vendor specific control requests, but there is no way to guess them, so they need to be documented by the device vendor.

Tagli
  • 2,412
  • 2
  • 11
  • 14