From: Uwe Hermann Date: Fri, 29 Jan 2016 17:00:11 +0000 (+0100) Subject: Use libusb_error_name() more often for better diagnostics. X-Git-Tag: libsigrok-0.4.0~12 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=eb8e6cd2cbcb9c552418dcd0b7973b38b88c805f;p=libsigrok.git Use libusb_error_name() more often for better diagnostics. --- diff --git a/src/hardware/hantek-dso/api.c b/src/hardware/hantek-dso/api.c index d96afdb2..5fe431d5 100644 --- a/src/hardware/hantek-dso/api.c +++ b/src/hardware/hantek-dso/api.c @@ -774,8 +774,8 @@ static void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer) sdi = transfer->user_data; devc = sdi->priv; - sr_spew("receive_transfer(): status %d received %d bytes.", - transfer->status, transfer->actual_length); + sr_spew("receive_transfer(): status %s received %d bytes.", + libusb_error_name(transfer->status), transfer->actual_length); if (transfer->actual_length == 0) /* Nothing to send to the bus. */ diff --git a/src/hardware/ikalogic-scanalogic2/protocol.c b/src/hardware/ikalogic-scanalogic2/protocol.c index 6db70261..03d5d1bf 100644 --- a/src/hardware/ikalogic-scanalogic2/protocol.c +++ b/src/hardware/ikalogic-scanalogic2/protocol.c @@ -270,7 +270,8 @@ SR_PRIV void LIBUSB_CALL sl2_receive_transfer_in( struct libusb_transfer *transf devc = sdi->priv; if (transfer->status != LIBUSB_TRANSFER_COMPLETED) { - sr_err("Transfer to device failed: %i.", transfer->status); + sr_err("Transfer to device failed: %s.", + libusb_error_name(transfer->status)); devc->transfer_error = TRUE; return; } @@ -400,7 +401,8 @@ SR_PRIV void LIBUSB_CALL sl2_receive_transfer_out( struct libusb_transfer *trans devc = sdi->priv; if (transfer->status != LIBUSB_TRANSFER_COMPLETED) { - sr_err("Transfer to device failed: %i.", transfer->status); + sr_err("Transfer to device failed: %s.", + libusb_error_name(transfer->status)); devc->transfer_error = TRUE; return; }