From: Martin Ling Date: Wed, 15 Jan 2014 17:06:46 +0000 (+0000) Subject: rigol-ds: Make sure to always send SR_DF_END at end of capture. X-Git-Tag: libsigrok-0.3.0~255 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=b751cf7a82ff04973e9525b42bb3e21ab88a1ab8;p=libsigrok.git rigol-ds: Make sure to always send SR_DF_END at end of capture. --- diff --git a/hardware/rigol-ds/api.c b/hardware/rigol-ds/api.c index 02abae9b..d6101874 100644 --- a/hardware/rigol-ds/api.c +++ b/hardware/rigol-ds/api.c @@ -891,6 +891,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) { struct dev_context *devc; struct sr_scpi_dev_inst *scpi; + struct sr_datafeed_packet packet; (void)cb_data; @@ -901,6 +902,10 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) return SR_ERR; } + /* End of last frame. */ + packet.type = SR_DF_END; + sr_session_send(sdi, &packet); + g_slist_free(devc->enabled_analog_probes); g_slist_free(devc->enabled_digital_probes); devc->enabled_analog_probes = NULL; diff --git a/hardware/rigol-ds/protocol.c b/hardware/rigol-ds/protocol.c index 5ede6d7c..69bb151e 100644 --- a/hardware/rigol-ds/protocol.c +++ b/hardware/rigol-ds/protocol.c @@ -590,9 +590,6 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data) devc->channel_entry = devc->enabled_digital_probes; rigol_ds_channel_start(sdi); } else if (++devc->num_frames == devc->limit_frames) { - /* End of last frame. */ - packet.type = SR_DF_END; - sr_session_send(sdi, &packet); sdi->driver->dev_acquisition_stop(sdi, cb_data); } else { /* Get the next frame, starting with the first analog channel. */