X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Frigol-ds%2Fprotocol.c;h=1344c8b420542398286f09b34f4c7345e15cd5ee;hb=53ea24610e5eb0750f98ed7fccccba4de0b4b5ba;hp=833104e890ddac4c74645a474b1a9077a011ffee;hpb=d2f7c417fdd96a13d8fd86350d2fc13db16f626c;p=libsigrok.git diff --git a/src/hardware/rigol-ds/protocol.c b/src/hardware/rigol-ds/protocol.c index 833104e8..1344c8b4 100644 --- a/src/hardware/rigol-ds/protocol.c +++ b/src/hardware/rigol-ds/protocol.c @@ -221,7 +221,7 @@ static int rigol_ds_check_stop(const struct sr_dev_inst *sdi) return SR_OK; if (ch->type == SR_CHANNEL_LOGIC) { - if (rigol_ds_config_set(sdi->conn, ":WAV:SOUR LA") != SR_OK) + if (rigol_ds_config_set(sdi, ":WAV:SOUR LA") != SR_OK) return SR_ERR; } else { if (rigol_ds_config_set(sdi, ":WAV:SOUR CHAN%d", @@ -440,7 +440,7 @@ SR_PRIV int rigol_ds_channel_start(const struct sr_dev_inst *sdi) break; case PROTOCOL_V3: if (ch->type == SR_CHANNEL_LOGIC) { - if (rigol_ds_config_set(sdi->conn, ":WAV:SOUR LA") != SR_OK) + if (rigol_ds_config_set(sdi, ":WAV:SOUR LA") != SR_OK) return SR_ERR; } else { if (rigol_ds_config_set(sdi, ":WAV:SOUR CHAN%d", @@ -631,7 +631,7 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data) /* Still reading the header. */ return TRUE; if (len == -1) { - sr_err("Read error, aborting capture."); + sr_err("Error while reading block header, aborting capture."); packet.type = SR_DF_FRAME_END; sr_session_send(sdi, &packet); sr_dev_acquisition_stop(sdi); @@ -664,7 +664,7 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data) len = sr_scpi_read_data(scpi, (char *)devc->buffer, len); if (len == -1) { - sr_err("Read error, aborting capture."); + sr_err("Error while reading block data, aborting capture."); packet.type = SR_DF_FRAME_END; sr_session_send(sdi, &packet); sr_dev_acquisition_stop(sdi); @@ -723,7 +723,8 @@ 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)) { + /* End acquisition when data for all channels is acquired. */ + if (!sr_scpi_read_complete(scpi) && !devc->channel_entry->next) { sr_err("Read should have been completed"); packet.type = SR_DF_FRAME_END; sr_session_send(sdi, &packet);