Hello,

 I have found a problem in scpi_serial.c in the scpi_serial_read_data
function. Incoming data is written at the read position in the buffer,
although it should be written at the count position in the buffer. The
attached patch should fix the issue.

Greetings,

Martin
diff --git a/src/scpi/scpi_serial.c b/src/scpi/scpi_serial.c
index 68a684c..0c6fe66 100644
--- a/src/scpi/scpi_serial.c
+++ b/src/scpi/scpi_serial.c
@@ -161,7 +161,7 @@ static int scpi_serial_read_data(void *priv, char *buf, int maxlen)
 
 	/* Try to read new data into the buffer if there is space. */
 	if (len > 0) {
-		ret = serial_read_nonblocking(sscpi->serial, sscpi->buffer + sscpi->read,
+		ret = serial_read_nonblocking(sscpi->serial, sscpi->buffer + sscpi->count,
 				BUFFER_SIZE - sscpi->count);
 
 		if (ret < 0)
------------------------------------------------------------------------------
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to