From df310ad1e2901266a2292ccc46067997ff303f16 Mon Sep 17 00:00:00 2001 From: C2D <50617709+i404788@users.noreply.github.com> Date: Fri, 13 Sep 2024 15:34:33 +0200 Subject: [PATCH] Fix DHO4000 memory readout The DHO4000 series uses 0-length bulk packets as response to some WAV requests presumably to extend the processing time it has (these are valid packets, see https://stackoverflow.com/a/30960597). I've also validated that this does fix loading large memory views. --- src/scpi/scpi_usbtmc_libusb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scpi/scpi_usbtmc_libusb.c b/src/scpi/scpi_usbtmc_libusb.c index 2da67030e..204a30465 100644 --- a/src/scpi/scpi_usbtmc_libusb.c +++ b/src/scpi/scpi_usbtmc_libusb.c @@ -629,7 +629,7 @@ static int scpi_usbtmc_libusb_read_data(void *priv, char *buf, int maxlen) if (uscpi->response_bytes_read >= uscpi->response_length) { if (uscpi->remaining_length > 0) { if (scpi_usbtmc_bulkin_continue(uscpi, uscpi->buffer, - sizeof(uscpi->buffer)) <= 0) + sizeof(uscpi->buffer)) < 0) return SR_ERR; } else { if (uscpi->bulkin_attributes & EOM)