diff options
author | Sean McBride <sean@rogue-research.com> | 2021-10-29 09:47:01 -0400 |
---|---|---|
committer | Tormod Volden <debian.tormod@gmail.com> | 2021-10-30 15:23:15 +0200 |
commit | 35b23a047e333ce361cea3315a15301286d89612 (patch) | |
tree | 2ae2a0dc0de5dae1fb600d86061f39dd8d8d68d5 | |
parent | 762456139aa0acde53d0e1b34e80076d921f1bf6 (diff) | |
download | libusb-35b23a047e333ce361cea3315a15301286d89612.tar.gz |
doc: Improve comments related to device discovery and hotplug
Closes #1013
-rw-r--r-- | libusb/core.c | 6 | ||||
-rw-r--r-- | libusb/hotplug.c | 2 | ||||
-rw-r--r-- | libusb/libusb.h | 2 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
4 files changed, 7 insertions, 5 deletions
diff --git a/libusb/core.c b/libusb/core.c index 90eb6d7..3d2f2b4 100644 --- a/libusb/core.c +++ b/libusb/core.c @@ -580,7 +580,9 @@ libusb_free_device_list(list, 1); * * The libusb_get_device_list() function can be used to obtain a list of * devices currently connected to the system. This is known as device - * discovery. + * discovery. Devices can also be discovered with the hotplug mechanism, + * whereby a callback function registered with libusb_hotplug_register_callback() + * will be called when a device of interest is connected or disconnected. * * Just because you have a reference to a device does not mean it is * necessarily usable. The device may have been unplugged, you may not have @@ -611,7 +613,7 @@ libusb_free_device_list(list, 1); * * With the above information in mind, the process of opening a device can * be viewed as follows: - * -# Discover devices using libusb_get_device_list(). + * -# Discover devices using libusb_get_device_list() or libusb_hotplug_register_callback(). * -# Choose the device that you want to operate, and call libusb_open(). * -# Unref all devices in the discovered device list. * -# Free the discovered device list. diff --git a/libusb/hotplug.c b/libusb/hotplug.c index 4bb2d4e..402e693 100644 --- a/libusb/hotplug.c +++ b/libusb/hotplug.c @@ -62,7 +62,7 @@ * A hotplug event can listen for either or both of these events. * * Note: If you receive notification that a device has left and you have any - * a libusb_device_handles for the device it is up to you to call libusb_close() + * libusb_device_handles for the device it is up to you to call libusb_close() * on each device handle to free up any remaining resources associated with the device. * Once a device has left any libusb_device_handle associated with the device * are invalid and will remain so even if the device comes back. diff --git a/libusb/libusb.h b/libusb/libusb.h index 0b3d854..2825b41 100644 --- a/libusb/libusb.h +++ b/libusb/libusb.h @@ -992,7 +992,7 @@ typedef struct libusb_context libusb_context; /** \ingroup libusb_dev * Structure representing a USB device detected on the system. This is an * opaque type for which you are only ever provided with a pointer, usually - * originating from libusb_get_device_list(). + * originating from libusb_get_device_list() or libusb_hotplug_register_callback(). * * Certain operations can be performed on a device, but in order to do any * I/O you will have to first obtain a device handle using libusb_open(). diff --git a/libusb/version_nano.h b/libusb/version_nano.h index a0cf63c..7bbbe39 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11661 +#define LIBUSB_NANO 11662 |