]> sigrok.org Git - libsigrok.git/commitdiff
rigol-ds: Only protocol v3 adds trailing linefeeds to data blocks.
authorMartin Ling <redacted>
Wed, 22 Jan 2014 04:49:57 +0000 (04:49 +0000)
committerBert Vermeulen <redacted>
Thu, 23 Jan 2014 00:42:33 +0000 (01:42 +0100)
hardware/rigol-ds/protocol.c

index 9a05dea94f2da7d289e3af2977208951df3b8ebc..8c66d63e8905aac57f493ceeb4f96d42b16bb005 100644 (file)
@@ -575,9 +575,11 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
 
                if (devc->num_block_read == devc->num_block_bytes) {
                        sr_dbg("Block has been completed");
-                       if (devc->format == FORMAT_IEEE488_2) {
+                       if (devc->model->series->protocol >= PROTOCOL_V3) {
                                /* Discard the terminating linefeed */
                                sr_scpi_read_data(scpi, (char *)devc->buffer, 1);
+                       }
+                       if (devc->format == FORMAT_IEEE488_2) {
                                /* Prepare for possible next block */
                                devc->num_block_bytes = 0;
                                if (devc->data_source != DATA_SOURCE_LIVE)