]> sigrok.org Git - libsigrok.git/commitdiff
rigol-ds: fix waveform reception on DS2000 series
authorAurelien Jacobs <redacted>
Wed, 1 Jan 2014 17:24:45 +0000 (18:24 +0100)
committerAurelien Jacobs <redacted>
Fri, 3 Jan 2014 16:54:47 +0000 (17:54 +0100)
The ":WAV:DATA?" scpi command must be sent before calling
sr_scpi_read_begin().

hardware/rigol-ds/protocol.c

index fc938e9d93763ff95dfc9ff00c4198a145201fed..eefed0745b8f3e9276c71c7c93ac56458f70cddf 100644 (file)
@@ -457,13 +457,17 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
 
                probe = devc->channel_entry->data;
                
+               if (devc->num_block_bytes == 0 &&
+                   devc->model->protocol == PROTOCOL_IEEE488_2) {
+                               if (sr_scpi_send(sdi->conn, ":WAV:DATA?") != SR_OK)
+                                       return TRUE;
+               }
+
                if (devc->num_block_bytes == 0) {
                        if (sr_scpi_read_begin(scpi) != SR_OK)
                                return TRUE;
                        if (devc->model->protocol == PROTOCOL_IEEE488_2) {
                                sr_dbg("New block header expected");
-                               if (sr_scpi_send(sdi->conn, ":WAV:DATA?") != SR_OK)
-                                       return TRUE;
                                len = rigol_ds_read_header(scpi);
                                if (len == -1)
                                        return TRUE;