+
+void hmcfgusb_close(struct hmcfgusb_dev *dev)
+{
+ int err;
+
+ if (dev->transfer) {
+ libusb_cancel_transfer(dev->transfer);
+ }
+
+ err = libusb_release_interface(dev->usb_devh, INTERFACE);
+ if ((err != 0)) {
+ fprintf(stderr, "Can't release interface: %s\n", usb_strerror(err));
+ }
+
+ libusb_close(dev->usb_devh);
+ free(dev->pfd);
+ free(dev);
+
+ libusb_exit(NULL);
+}
+
+void hmcfgusb_set_debug(int d)
+{
+ debug = d;
+}