]> sigrok.org Git - libsigrok.git/commitdiff
Use libusb_error_name() more often for better diagnostics.
authorUwe Hermann <redacted>
Fri, 29 Jan 2016 17:00:11 +0000 (18:00 +0100)
committerUwe Hermann <redacted>
Fri, 29 Jan 2016 17:00:11 +0000 (18:00 +0100)
src/hardware/hantek-dso/api.c
src/hardware/ikalogic-scanalogic2/protocol.c

index d96afdb2f68318585fc65e40fc7351d98b777f42..5fe431d5be7c468f219ce8b81b32431fbd1b88b9 100644 (file)
@@ -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. */
index 6db7026115faa0b31164ee9676986fcf8bd60938..03d5d1bf32df778c0f824b29a8fb5fbc672d1933 100644 (file)
@@ -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;
        }