]> sigrok.org Git - libsigrok.git/commitdiff
hameg-hmo: Send the DF_END packet in acquisition_stop()
authorpoljar (Damir Jelić) <redacted>
Thu, 16 Jan 2014 14:28:52 +0000 (15:28 +0100)
committerBert Vermeulen <redacted>
Thu, 16 Jan 2014 15:27:35 +0000 (16:27 +0100)
The DF_END packet was send out after all configured frames were fetched, but
devices may stop the acquisition at any point in time and an DF_END will not be
send out in this case.

Send the DF_END packet inside of acquisition_stop() so this can't happen.

hardware/hameg-hmo/api.c
hardware/hameg-hmo/protocol.c

index 3b474921d6699cfac35c717d5484b9a5ee652986..9e1d6e1ff2c88cd26feb300fed864b53d2dd2f8e 100644 (file)
@@ -882,9 +882,14 @@ 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;
 
+       packet.type = SR_DF_END;
+       packet.payload = NULL;
+       sr_session_send(sdi, &packet);
+
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
index 2f7f5ab43999c1dc987b9c0972aba522477efdb6..f3de763895e7cbf0c1b39f187b0c15bf5d2391bd 100644 (file)
@@ -621,8 +621,6 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data)
                        devc->current_probe = devc->current_probe->next;
                        hmo_request_data(sdi);
                } else if (++devc->num_frames == devc->frame_limit) {
-                       packet.type = SR_DF_END;
-                       sr_session_send(sdi, &packet);
                        sdi->driver->dev_acquisition_stop(sdi, cb_data);
                } else {
                        devc->current_probe = devc->enabled_probes;