+static char * usb_str_transfer_status(int e)
+{
+ static char unknerr[256];
+
+ switch (e) {
+ case LIBUSB_TRANSFER_COMPLETED:
+ return "Transfer completed";
+ case LIBUSB_TRANSFER_ERROR:
+ return "Transfer error";
+ case LIBUSB_TRANSFER_TIMED_OUT:
+ return "Transfer timed out";
+ case LIBUSB_TRANSFER_CANCELLED:
+ return "Transfer cancelled";
+ case LIBUSB_TRANSFER_STALL:
+ return "No device";
+ case LIBUSB_TRANSFER_OVERFLOW:
+ return "Transfer overflow";
+ };
+ snprintf(unknerr, sizeof(unknerr), "Unknown transfer status %d / 0x%02x", e, e);
+ return unknerr;
+}
+