serial = sr_serial_dev_inst_new(conn, serialcomm);
- if (serial_open(serial, SERIAL_RDWR) != SR_OK)
+ if (serial_open(serial, SERIAL_RDWR) != SR_OK) {
+ g_free(sdi);
return NULL;
+ }
sdi->inst_type = SR_INST_SERIAL;
sdi->conn = serial;
return std_scan_complete(di, g_slist_append(NULL, sdi));
}
-static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
- const struct sr_channel_group *cg)
+static int config_set(uint32_t key, GVariant *data,
+ const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
{
struct dev_context *devc;
return sr_sw_limits_config_set(&devc->limits, key, data);
}
-static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
- const struct sr_channel_group *cg)
+static int config_list(uint32_t key, GVariant **data,
+ const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
{
return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
}
sr_sw_limits_acquisition_start(&devc->limits);
- /* Poll every 500ms, or whenever some data comes in. */
serial = sdi->conn;
serial_source_add(sdi->session, serial, G_IO_IN, 500,
tondaj_sl_814_receive_data, (void *)sdi);