]> sigrok.org Git - libsigrok.git/blobdiff - hardware/rigol-ds/protocol.c
rigol-ds: prevent config_list() to return empty g_variant
[libsigrok.git] / hardware / rigol-ds / protocol.c
index fc938e9d93763ff95dfc9ff00c4198a145201fed..9952e2a41517b0865e0b458ea3a324002e25d80f 100644 (file)
@@ -423,7 +423,7 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
 
        scpi = sdi->conn;
 
-       if (revents == G_IO_IN) {
+       if (revents == G_IO_IN || revents == 0) {
                if (devc->model->protocol == PROTOCOL_IEEE488_2) {
                        switch(devc->wait_event) {
                        case WAIT_NONE:
@@ -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;