Documentation: fix hotplug example

* add a missing call to libusb_handle_events_completed()
* add a missing argument to libusb_hotplug_deregister_callback()
This commit is contained in:
Markus Heidelberg
2014-02-02 15:41:20 +01:00
committed by Ludovic Rousseau
parent 77212172a1
commit 93de199d8d
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -86,6 +86,10 @@
*
* The following code provides an example of the usage of the hotplug interface:
\code
#include <stdio.h>
#include <stdlib.h>
#include <libusb.h>
static int count = 0;
int hotplug_callback(struct libusb_context *ctx, struct libusb_device *dev,
@@ -131,10 +135,11 @@ int main (void) {
}
while (count < 2) {
libusb_handle_events_completed(NULL, NULL);
usleep(10000);
}
libusb_hotplug_deregister_callback(handle);
libusb_hotplug_deregister_callback(NULL, handle);
libusb_exit(NULL);
return 0;
+1 -1
View File
@@ -1 +1 @@
#define LIBUSB_NANO 10867
#define LIBUSB_NANO 10868