Refine libusb_set_configuration() semantics
authorDaniel Drake <dsd@gentoo.org>
Thu, 29 May 2008 11:35:01 +0000 (12:35 +0100)
committerDaniel Drake <dsd@gentoo.org>
Thu, 29 May 2008 11:35:01 +0000 (12:35 +0100)
commit514bb8790cfe8b93ccfff82bc17081b1030acce0
tree8a59c368cbca414f2dc46532593ee7be463d5934
parentd1292f8e7300051239a7ed2769d221dc7a6f9fca
Refine libusb_set_configuration() semantics

Applications will generally want to set a configuration before claiming
interfaces. The problem is that the interface may already be set, and
someone else may have claimed an interface (meaning that all calls to
set_configuration will fail, even if it's for the same configuration).

There are now 2 options:
1. Use the new libusb_get_configuration() to determine active
   configuration before calling libusb_set_configuration()
2. Or just call libusb_set_configuration() as usual, which will do
   nothing if that configuration is already active.
libusb/core.c
libusb/libusbi.h
libusb/os/linux_usbfs.c