]> sigrok.org Git - libsigrok.git/commitdiff
rigol-ds: Check SCPI read is complete after reading expected block length.
authorMartin Ling <redacted>
Fri, 17 Jan 2014 02:27:29 +0000 (02:27 +0000)
committerMartin Ling <redacted>
Mon, 20 Jan 2014 00:24:14 +0000 (00:24 +0000)
hardware/rigol-ds/protocol.c

index 1d2302f60c4bb949a99b7d9e0ea6b27e855fc7db..0dc36cf4d822fdab0c10ca370faafef8434bc187 100644 (file)
@@ -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);