title: libusb is throwing LIBUSB_ERROR_NOT_FOUND on libusb_bulk_transfer()
body: <p>My problem is that libusb won't transfer a bulk for reading input from my keyboard. Here is the code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;libusb-1.0/libusb.h&gt;
  
  int main(void)
  {
  
      libusb_init(NULL);
  
      libusb_device **list;
      libusb_device *found = NULL;
      ssize_t cnt = libusb_get_device_list(NULL, &amp;list);
      ssize_t i = 0;
  
      struct libusb_device_descriptor desc;
      libusb_device_handle *h;
  
      unsigned char strDesc[128];
  
      for (i = 0; i &lt; cnt; i++) {
          libusb_device *device = list[i];
          libusb_get_device_descriptor(device, &amp;desc);
          if (desc.idProduct == 0x203) {
              libusb_open(device, &amp;h);
              libusb_get_string_descriptor_ascii(h, desc.iProduct, strDesc, 128);
              printf("=== %s found in host ===\n", strDesc);
  
              found = device;
  
              break;
          }
      }
  
      libusb_device_handle *handle;
      libusb_open(found, &amp;handle);
  
      unsigned char data[16];
      int act_len;
  
      libusb_get_device_descriptor(found, &amp;desc);
  
      int r = libusb_bulk_transfer(handle, LIBUSB_ENDPOINT_IN, data, sizeof(data), &amp;act_len, 0);
      const char *err = libusb_error_name(r);
      printf("%s\n", err);
  
      libusb_free_device_list(list, 1);
      libusb_close(handle);
  
      return 0;
  }
  </code></pre>
  
  <p>Basically it loops through all listed devices until it finds my keyboard, with pId 0x203. Then it tries to initiate a <code>libusb_bulk_transfer()</code> but at execution time it throws a <code>LIBUSB_ERROR_NOT_FOUND</code>.
  Anyone can help me out with this? I have searched but seems that no one has a solution. Thanks!</p>
  
  <p>I am running OS X 10.10.1.</p>