title: Writing raw data to the Android Serial Port (USB)
body: <p>I need to write some "raw" data to the usb port for a project of mine (no prob if root should be required).</p>
  
  <p>I found a <a href="https://github.com/monaka/libusb-android" rel="nofollow">port of libusb for Android</a> and managed to compile it with NDK. I linked the library to an executable of mine (executed as root), but the function "libusb_init" always returns an error (LIBUSB_ERROR_OTHER). </p>
  
  <p>I found that the problem (by now...) is in the file "linux_usbfs.c", more precisely in this function:</p>
  
  <pre><code>static const char *find_usbfs_path(void)
  {
      const char *path = "/dev/bus/usb";
      const char *ret = NULL;
  
      if (check_usb_vfs(path)) {
          ret = path;
      } else {
          path = "/proc/bus/usb";
          if (check_usb_vfs(path))
              ret = path;
      }
  
      usbi_dbg("found usbfs at %s", ret);
      return ret;
  }
  </code></pre>
  
  <p><code>/dev/bus/usb</code> obviously doesn't exist on my N1.</p>