X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fnorma-dmm%2Fapi.c;h=d0089c62949e5245f0965ecc8bd7b440c3a71b51;hb=bf72f649999a6e8741ffee1ca2850db4d478f9f8;hp=991a839b5adbb910f04bd46a89fc7d27470a8db6;hpb=e790bd5cda9ccf99474b2d4998d3dd4e204416ea;p=libsigrok.git diff --git a/hardware/norma-dmm/api.c b/hardware/norma-dmm/api.c index 991a839b..d0089c62 100644 --- a/hardware/norma-dmm/api.c +++ b/hardware/norma-dmm/api.c @@ -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;