]> sigrok.org Git - libsigrok.git/commitdiff
rigol-ds1xx2: Send a SR_DF_END packet before acquisition stop.
authorpoljar (Damir Jelić) <redacted>
Fri, 15 Nov 2013 15:54:55 +0000 (16:54 +0100)
committerBert Vermeulen <redacted>
Fri, 15 Nov 2013 16:00:07 +0000 (17:00 +0100)
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.

hardware/rigol-ds1xx2/protocol.c

index 001d671b68de2072caad6e33dfcf477ab3de8465..0efff69397376020896c17a353e6c6482febed01 100644 (file)
@@ -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. */