title: Lib usb how to read character from port
body: <p>I want to write an application that reads data from the USB device and was looking for a library that can make the job easier. I found a library called <code>lib-usb</code>. Unfortunately, it has almost no documentation. Here is what I have tried:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;usb.h&gt;
  
       int main(){
          struct usb_device dev;
          struct usb_device *device;
          usb_dev_handle *handle;
          struct usb_bus bus;
  
  usb_init();
              usb_find_busses();
              int a=usb_find_devices();
          bus=usb_get_buses();
          handle=usb_open(device);
  
              return 0;
          }
  </code></pre>
  
  <p>But I can't figure out how to select a port that I want to read from. I would like to save read data as a string. Any advice is appreciated.</p>