]> sigrok.org Git - libsigrok.git/blobdiff - hardware/brymen-bm86x/api.c
build: Portability fixes.
[libsigrok.git] / hardware / brymen-bm86x / api.c
index 22a4862af4da0d5dcffbd0719ae8a5b8a6269ce9..be21583b169b15199077e7ec975d92430ae33f2a 100644 (file)
@@ -86,10 +86,10 @@ static GSList *scan(GSList *options)
 
                sdi->priv = devc;
                sdi->driver = di;
-               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1")))
                        return NULL;
                sdi->channels = g_slist_append(sdi->channels, ch);
-               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P2")))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P2")))
                        return NULL;
                sdi->channels = g_slist_append(sdi->channels, ch);
 
@@ -261,17 +261,19 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi,
 {
        struct dev_context *devc;
 
+       (void)cb_data;
+
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
        devc = sdi->priv;
-       devc->session_cb_data = cb_data;
        devc->start_time = g_get_monotonic_time();
 
        /* Send header packet to the session bus. */
-       std_session_send_df_header(cb_data, LOG_PREFIX);
+       std_session_send_df_header(sdi, LOG_PREFIX);
 
-       sr_source_add(0, 0, 10, brymen_bm86x_receive_data, (void *)sdi);
+       sr_session_source_add(sdi->session, 0, 0, 10,
+                       brymen_bm86x_receive_data, (void *)sdi);
 
        return SR_OK;
 }
@@ -280,14 +282,16 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
 {
        struct sr_datafeed_packet packet;
 
+       (void)cb_data;
+
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
        /* Send end packet to the session bus. */
        packet.type = SR_DF_END;
-       sr_session_send(cb_data, &packet);
+       sr_session_send(sdi, &packet);
 
-       sr_source_remove(0);
+       sr_session_source_remove(sdi->session, 0);
 
        return SR_OK;
 }