Skip to content

Commit

Permalink
Log syncronous calls when using the asyncronous libusb adaptor.
Browse files Browse the repository at this point in the history
  • Loading branch information
nomis52 committed Dec 21, 2014
1 parent ceb2ed8 commit 33d92d2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
23 changes: 19 additions & 4 deletions plugins/usbdmx/LibUsbAdaptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,22 @@ int AsyncronousLibUsbAdaptor::ControlTransfer(
OLA_UNUSED unsigned char *data,
OLA_UNUSED uint16_t wLength,
OLA_UNUSED unsigned int timeout) {
OLA_WARN << "libusb_control_transfer in an AsyncronousLibUsbAdaptor";
return LIBUSB_ERROR_NOT_SUPPORTED;
OLA_DEBUG << "libusb_control_transfer in an AsyncronousLibUsbAdaptor";
return BaseLibUsbAdaptor::ControlTransfer(dev_handle, bmRequestType,
bRequest, wValue, wIndex, data,
wLength, timeout);
}

int AsyncronousLibUsbAdaptor::BulkTransfer(
struct libusb_device_handle *dev_handle,
unsigned char endpoint,
unsigned char *data,
int length,
int *transferred,
unsigned int timeout) {
OLA_DEBUG << "libusb_bulk_transfer in an AsyncronousLibUsbAdaptor";
return BaseLibUsbAdaptor::BulkTransfer(dev_handle, endpoint, data, length,
transferred, timeout);
}

int AsyncronousLibUsbAdaptor::InterruptTransfer(
Expand All @@ -362,8 +376,9 @@ int AsyncronousLibUsbAdaptor::InterruptTransfer(
OLA_UNUSED int length,
OLA_UNUSED int *actual_length,
OLA_UNUSED unsigned int timeout) {
OLA_WARN << "libusb_interrupt_transfer in an AsyncronousLibUsbAdaptor";
return LIBUSB_ERROR_NOT_SUPPORTED;
OLA_DEBUG << "libusb_interrupt_transfer in an AsyncronousLibUsbAdaptor";
return BaseLibUsbAdaptor::InterruptTransfer(dev_handle, endpoint, data,
length, actual_length, timeout);
}
} // namespace usbdmx
} // namespace plugin
Expand Down
7 changes: 7 additions & 0 deletions plugins/usbdmx/LibUsbAdaptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,13 @@ class AsyncronousLibUsbAdaptor : public BaseLibUsbAdaptor {
uint16_t wLength,
unsigned int timeout);

int BulkTransfer(struct libusb_device_handle *dev_handle,
unsigned char endpoint,
unsigned char *data,
int length,
int *transferred,
unsigned int timeout);

int InterruptTransfer(libusb_device_handle *dev_handle,
unsigned char endpoint,
unsigned char *data,
Expand Down

0 comments on commit 33d92d2

Please sign in to comment.