]> sigrok.org Git - libsigrok.git/blobdiff - src/session_driver.c
Introduce standard implementation of the dev_list() callback
[libsigrok.git] / src / session_driver.c
index cfa1da9d2ac0beaf24c182bf0d1614e0a30e5395..d56c22c23866f088323f4c8ab43d669396572f13 100644 (file)
@@ -178,7 +178,6 @@ static int receive_data(int fd, int revents, void *cb_data)
 {
        struct sr_dev_inst *sdi;
        struct session_vdev *vdev;
-       struct sr_datafeed_packet packet;
 
        (void)fd;
        (void)revents;
@@ -199,9 +198,8 @@ static int receive_data(int fd, int revents, void *cb_data)
                zip_discard(vdev->archive);
                vdev->archive = NULL;
        }
-       packet.type = SR_DF_END;
-       packet.payload = NULL;
-       sr_session_send(sdi, &packet);
+
+       std_session_send_df_end(sdi, LOG_PREFIX);
 
        return G_SOURCE_REMOVE;
 }
@@ -338,15 +336,13 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
        return SR_OK;
 }
 
-static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
+static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 {
        struct session_vdev *vdev;
        int ret;
        GSList *l;
        struct sr_channel *ch;
 
-       (void)cb_data;
-
        vdev = sdi->priv;
        vdev->bytes_read = 0;
        vdev->cur_analog_channel = 0;
@@ -369,7 +365,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
                return SR_ERR;
        }
 
-       /* Send header packet to the session bus. */
        std_session_send_df_header(sdi, LOG_PREFIX);
 
        /* freewheeling source */
@@ -378,11 +373,10 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        return SR_OK;
 }
 
-static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
+static int dev_acquisition_stop(struct sr_dev_inst *sdi)
 {
        struct session_vdev *vdev;
 
-       (void)cb_data;
        vdev = sdi->priv;
 
        vdev->finished = TRUE;