From: poljar (Damir Jelić) Date: Fri, 15 Nov 2013 15:54:55 +0000 (+0100) Subject: rigol-ds1xx2: Send a SR_DF_END packet before acquisition stop. X-Git-Tag: libsigrok-0.3.0~555 X-Git-Url: https://sigrok.org/gitweb/?a=commitdiff_plain;h=1130e4229b2df4b9f308761928d44747cd568aee;hp=449cc16bb279e5d3322846ce6bd390e867e71ccb;p=libsigrok.git rigol-ds1xx2: Send a SR_DF_END packet before acquisition stop. Without a SR_DF_END samples could be cached in the internal buffer of an output module and never flushed, therefore they would be missing in the final output. By sending a SR_DF_END packet we force the output to be flushed. --- diff --git a/hardware/rigol-ds1xx2/protocol.c b/hardware/rigol-ds1xx2/protocol.c index 001d671b..0efff693 100644 --- a/hardware/rigol-ds1xx2/protocol.c +++ b/hardware/rigol-ds1xx2/protocol.c @@ -123,6 +123,8 @@ SR_PRIV int rigol_ds1xx2_receive(int fd, int revents, void *cb_data) rigol_ds1xx2_send(sdi, ":WAV:DATA? DIG"); } 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. */