+ /* Checking that the configuration has not changed, as suggested in
+ * http://libusb.sourceforge.net/api-1.0/caveats.html
+ */
+ current_configuration = -1;
+ ret = libusb_get_configuration(dev, ¤t_configuration);
+ if (ret < 0) {
+ fprintf(stderr, "libusb_get_configuration after claim failed: %s\n",
+ libusb_error_name(ret));
+ goto out_libusb_release_interface;
+ }
+
+ if (current_configuration != VISOMAT_CONFIGURATION) {
+ fprintf(stderr, "libusb configuration changed (expected: %hhu, current: %hhu\n",
+ VISOMAT_CONFIGURATION, current_configuration);
+ ret = -EINVAL;
+ goto out_libusb_release_interface;
+ }
+