static const char *supported_models[] = {
"DS1052E",
"DS1102E",
+ "DS1152E",
"DS1052D",
"DS1102D",
+ "DS1152D",
};
SR_PRIV struct sr_dev_driver rigol_ds1xx2_driver_info;
{
struct dev_context *devc;
- devc = priv;
+ for (l = drvc->instances; l; l = l->next) {
+ if (!(sdi = l->data))
+ continue;
+
+ if (sdi->conn)
+ sr_serial_dev_inst_free(sdi->conn);
+
+ g_slist_free(sdi->probe_groups);
+
+ if (!(devc = sdi->priv))
+ continue;
+
+ g_free(devc->device);
+ g_free(devc->coupling[0]);
+ g_free(devc->coupling[1]);
+ g_free(devc->trigger_source);
+ g_free(devc->trigger_slope);
+ g_slist_free(devc->analog_groups[0].probes);
+ g_slist_free(devc->analog_groups[1].probes);
+ g_slist_free(devc->digital_group.probes);
+ close(devc->fd);
+
+ sr_dev_inst_free(sdi);
+ }
g_free(devc->coupling[0]);
g_free(devc->coupling[1]);
g_free(devc->trigger_slope);
}
-static int clear_instances(void)
+static int dev_clear(void)
{
return std_dev_clear(di, clear_helper);
}
devc->has_digital = has_digital;
for (i = 0; i < 2; i++) {
- if (!(probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE,
- i == 0 ? "CH1" : "CH2")))
+ channel_name = (i == 0 ? "CH1" : "CH2");
+ if (!(probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE, channel_name)))
return SR_ERR_MALLOC;
sdi->probes = g_slist_append(sdi->probes, probe);
+ devc->analog_groups[i].name = channel_name;
+ devc->analog_groups[i].probes = g_slist_append(NULL, probe);
+ sdi->probe_groups = g_slist_append(sdi->probe_groups,
+ &devc->analog_groups[i]);
}
if (devc->has_digital) {
if (!probe)
return SR_ERR_MALLOC;
sdi->probes = g_slist_append(sdi->probes, probe);
+ devc->digital_group.probes = g_slist_append(
+ devc->digital_group.probes, probe);
+ devc->digital_group.name = "LA";
+ sdi->probe_groups = g_slist_append(sdi->probe_groups,
+ &devc->digital_group);
}
}
sdi->priv = devc;
if (probe_port(port, &devices) == SR_ERR_MALLOC)
return NULL;
} else {
- if (!(dir = g_dir_open("/sys/class/usb/", 0, NULL)))
- return NULL;
+ if (!(dir = g_dir_open("/sys/class/usbmisc/", 0, NULL)))
+ if (!(dir = g_dir_open("/sys/class/usb/", 0, NULL)))
+ return NULL;
while ((dev_name = g_dir_read_name(dir))) {
if (strncmp(dev_name, "usbtmc", 6))
continue;
static int cleanup(void)
{
- return clear_instances();
+ return dev_clear();
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_probe_group *probe_group)
{
(void)sdi;
+ (void)probe_group;
switch (id) {
case SR_CONF_NUM_TIMEBASE:
return SR_OK;
}
-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;
uint64_t tmp_u64, p, q;
int ret;
const char *tmp_str;
+ (void)probe_group;
+
devc = sdi->priv;
if (sdi->status != SR_ST_ACTIVE)
return ret;
}
-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)
{
GVariant *tuple, *rational[2];
GVariantBuilder gvb;
unsigned int i;
struct dev_context *devc;
+ (void)probe_group;
+
switch (key) {
case SR_CONF_SCAN_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
.cleanup = cleanup,
.scan = scan,
.dev_list = dev_list,
- .dev_clear = clear_instances,
+ .dev_clear = dev_clear,
.config_get = config_get,
.config_set = config_set,
.config_list = config_list,