]> sigrok.org Git - libsigrok.git/blobdiff - hardware/tondaj-sl-814/api.c
build: Portability fixes.
[libsigrok.git] / hardware / tondaj-sl-814 / api.c
index 0eb14b06144eb2aa105a3fa8d493c7c3a34fdc19..7917c8d2606bc24dac697b5964a776787bde5265 100644 (file)
@@ -51,7 +51,7 @@ static GSList *scan(GSList *options)
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct sr_config *src;
-       struct sr_probe *probe;
+       struct sr_channel *ch;
        GSList *devices, *l;
        const char *conn, *serialcomm;
        struct sr_serial_dev_inst *serial;
@@ -106,12 +106,12 @@ static GSList *scan(GSList *options)
 
        sdi->priv = devc;
        sdi->driver = di;
-       probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1");
-       if (!probe) {
-               sr_err("Failed to create probe.");
+       ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1");
+       if (!ch) {
+               sr_err("Failed to create channel.");
                return NULL;
        }
-       sdi->probes = g_slist_append(sdi->probes, probe);
+       sdi->channels = g_slist_append(sdi->channels, ch);
        drvc->instances = g_slist_append(drvc->instances, sdi);
        devices = g_slist_append(devices, sdi);
 
@@ -129,11 +129,11 @@ static int cleanup(void)
 }
 
 static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
-               const struct sr_channel_group *channel_group)
+               const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
 
-       (void)channel_group;
+       (void)cg;
 
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
@@ -154,10 +154,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
 }
 
 static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
-               const struct sr_channel_group *channel_group)
+               const struct sr_channel_group *cg)
 {
        (void)sdi;
-       (void)channel_group;
+       (void)cg;
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
@@ -192,7 +192,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi,
 
        /* Poll every 500ms, or whenever some data comes in. */
        serial = sdi->conn;
-       serial_source_add(serial, G_IO_IN, 500,
+       serial_source_add(sdi->session, serial, G_IO_IN, 500,
                      tondaj_sl_814_receive_data, (void *)sdi);
 
        return SR_OK;