path: root/include/usbhost
diff options
authorGuillaume Ranquet <>2012-10-23 17:11:44 +0200
committerGuillaume Ranquet <>2012-12-10 11:12:35 +0100
commitdea46b6657845a366d13f57c720eab28c9062ab7 (patch)
treeede3e458260f4d502de8f600839cc48476ce304f /include/usbhost
parent777991d9399f1268d27c72a03d56c1a36068a57f (diff)
libusbhost: permits client polling on inotify wd
Modify libusbhost to expose the inotify watch descriptor to clients This modification permits clients to add the watch descriptor to their polling loop so that they don't have to use a dedicated thread only for libusbhost. Change-Id: I615bfcd56beab978135034b228d4d93337351eab Signed-off-by: Guillaume Ranquet <> Signed-off-by: Luc Piguet-Lacroix <>
Diffstat (limited to 'include/usbhost')
1 files changed, 13 insertions, 0 deletions
diff --git a/include/usbhost/usbhost.h b/include/usbhost/usbhost.h
index 9a6b59c5f..1d67c12a9 100644
--- a/include/usbhost/usbhost.h
+++ b/include/usbhost/usbhost.h
@@ -72,6 +72,19 @@ struct usb_host_context *usb_host_init(void);
/* Call this to cleanup the USB host library. */
void usb_host_cleanup(struct usb_host_context *context);
+/* Call this to get the inotify file descriptor. */
+int usb_host_get_fd(struct usb_host_context *context);
+/* Call this to initialize the usb host context. */
+int usb_host_load(struct usb_host_context *context,
+ usb_device_added_cb added_cb,
+ usb_device_removed_cb removed_cb,
+ usb_discovery_done_cb discovery_done_cb,
+ void *client_data);
+/* Call this to read and handle occuring usb event. */
+int usb_host_read_event(struct usb_host_context *context);
/* Call this to monitor the USB bus for new and removed devices.
* This is intended to be called from a dedicated thread,
* as it will not return until one of the callbacks returns true.