From: Martin Ling Date: Fri, 17 Jan 2014 02:27:29 +0000 (+0000) Subject: rigol-ds: Check SCPI read is complete after reading expected block length. X-Git-Tag: libsigrok-0.3.0~240 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=3ed7a40c753128d73875282cd318e1c8d96b360a;p=libsigrok.git rigol-ds: Check SCPI read is complete after reading expected block length. --- diff --git a/hardware/rigol-ds/protocol.c b/hardware/rigol-ds/protocol.c index 1d2302f6..0dc36cf4 100644 --- a/hardware/rigol-ds/protocol.c +++ b/hardware/rigol-ds/protocol.c @@ -540,6 +540,11 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data) if (devc->data_source != DATA_SOURCE_LIVE) rigol_ds_set_wait_event(devc, WAIT_BLOCK); } + if (!sr_scpi_read_complete(scpi)) { + sr_err("Read should have been completed"); + sdi->driver->dev_acquisition_stop(sdi, cb_data); + return TRUE; + } devc->num_block_read = 0; } else { sr_dbg("%d of %d block bytes read", devc->num_block_read, devc->num_block_bytes);