]> sigrok.org Git - libsigrok.git/blobdiff - hardware/agilent-dmm/api.c
Route sr_source_add for all serial devices through a serial_source_add wrapper.
[libsigrok.git] / hardware / agilent-dmm / api.c
index 34fa92ad507db894c1a96ad3558d170859404b57..d4c9427d49b95b89ac515e8446abfde55e35f375 100644 (file)
@@ -129,7 +129,7 @@ static GSList *scan(GSList *options)
 
        tokens = g_strsplit(buf, ",", 4);
        if (!strcmp("Agilent Technologies", tokens[0])
-                       && tokens[2] && tokens[3]) {
+                       && tokens[1] && tokens[2] && tokens[3]) {
                for (i = 0; supported_agdmm[i].model; i++) {
                        if (strcmp(supported_agdmm[i].modelname, tokens[1]))
                                continue;
@@ -200,10 +200,13 @@ static int cleanup(void)
        return dev_clear();
 }
 
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+               const struct sr_probe_group *probe_group)
 {
        struct dev_context *devc;
 
+       (void)probe_group;
+
        if (sdi->status != SR_ST_ACTIVE)
                return SR_ERR_DEV_CLOSED;
 
@@ -235,10 +238,11 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
        return SR_OK;
 }
 
-static int config_list(int key, 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_probe_group *probe_group)
 {
-
        (void)sdi;
+       (void)probe_group;
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
@@ -276,7 +280,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
 
        /* Poll every 100ms, or whenever some data comes in. */
        serial = sdi->conn;
-       sr_source_add(serial->fd, G_IO_IN, 100, agdmm_receive_data, (void *)sdi);
+       serial_source_add(serial, G_IO_IN, 100, agdmm_receive_data, (void *)sdi);
 
        return SR_OK;
 }