devc = g_malloc0(sizeof(struct dev_context));
sr_sw_limits_init(&devc->limits);
devc->type = auxtype;
- devc->version = g_strdup(&buf[9]);
sdi->conn = serial;
sdi->priv = devc;
sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "P1");
return std_scan_complete(drv, devices);
}
-static int dev_close(struct sr_dev_inst *sdi)
-{
- struct dev_context *devc;
-
- std_serial_dev_close(sdi);
-
- /* Free dynamically allocated resources. */
- if ((devc = sdi->priv) && devc->version) {
- g_free(devc->version);
- devc->version = NULL;
- }
-
- return SR_OK;
-}
-
static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
- return std_serial_dev_acquisition_stop(sdi, dev_close,
+ return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
sdi->conn, LOG_PREFIX);
}
.config_set = config_set,
.config_list = config_list,
.dev_open = std_serial_dev_open,
- .dev_close = dev_close,
+ .dev_close = std_serial_dev_close,
.dev_acquisition_start = dev_acquisition_start,
.dev_acquisition_stop = dev_acquisition_stop,
.context = NULL,
.config_set = config_set,
.config_list = config_list,
.dev_open = std_serial_dev_open,
- .dev_close = dev_close,
+ .dev_close = std_serial_dev_close,
.dev_acquisition_start = dev_acquisition_start,
.dev_acquisition_stop = dev_acquisition_stop,
.context = NULL,