]> sigrok.org Git - libsigrok.git/blobdiff - hardware/norma-dmm/api.c
ols: Get fd from sp_get_port_handle() rather than serial struct.
[libsigrok.git] / hardware / norma-dmm / api.c
index 991a839b5adbb910f04bd46a89fc7d27470a8db6..d0089c62949e5245f0965ecc8bd7b440c3a71b51 100644 (file)
@@ -183,14 +183,9 @@ static int dev_open(struct sr_dev_inst *sdi)
 
 static int dev_close(struct sr_dev_inst *sdi)
 {
-       struct sr_serial_dev_inst *serial;
        struct dev_context *devc;
 
-       serial = sdi->conn;
-       if (serial && serial->fd != -1) {
-               serial_close(serial);
-               sdi->status = SR_ST_INACTIVE;
-       }
+       std_serial_dev_close(sdi);
 
        /* Free dynamically allocated resources. */
        if ((devc = sdi->priv) && devc->version) {
@@ -207,10 +202,13 @@ static int cleanup(void)
        return dev_clear();
 }
 
-static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int key, 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;
 
@@ -242,9 +240,11 @@ static int config_set(int key, 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:
@@ -288,7 +288,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi,
 
        /* Poll every 100ms, or whenever some data comes in. */
        serial = sdi->conn;
-       sr_source_add(serial->fd, G_IO_IN, 100, norma_dmm_receive_data,
+       serial_source_add(serial, G_IO_IN, 100, norma_dmm_receive_data,
                      (void *)sdi);
 
        return SR_OK;