title: libusb LIBUSB_ERROR_IO when transferring
body: <p>I am running the program below which returns an error code(-1, LIBUSB_ERROR_IO, Bytes sent: 0) when trying to transfer the data. I am using the libusb-1.0 dll.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include "inc/libusb.h"
  
  int main(void) {
      libusb_device_handle *dev_handle;
  
      unsigned char buf[5] = {0x04, 0x00, 0x06, 0x06, 0x00};
  
      int r, bytes_sent = 0;
  
      if(libusb_init(NULL)) return 1;
      dev_handle = libusb_open_device_with_vid_pid(NULL, 0x1b1c, 0x0c04);
      libusb_claim_interface(dev_handle, 0);
  
      r = libusb_interrupt_transfer(dev_handle, 0x81, buf, 5, &amp;bytes_sent, 0);
  
      printf("Return code: %d\nBytes sent: %d\n", r, bytes_sent);
  
      libusb_release_interface(dev_handle, 0);
      libusb_close(dev_handle);
      libusb_exit(NULL);
  
      return 0;
  }
  </code></pre>
  
  <p>Also, I am not sure that I am using the correct endpoint address. These are some images from usbview: <a href="http://i.imgur.com/4FFaOkq.png" rel="nofollow">http://i.imgur.com/4FFaOkq.png</a>, <a href="http://i.imgur.com/B9cEoV6.png" rel="nofollow">http://i.imgur.com/B9cEoV6.png</a>. The first one shows the device I am trying to communicate with. Since not much information is provided from the device in the first image I use the information from the second image. I am right in assuming I need to use interrupt communication with this device, judging from the transfer type, under the endpoint descriptor? </p>
  
  <p>Finally, is it possible that libusb might not be right for communicating with the specific device and I need to use another library?(eg. hidapi)</p>