{ FLUKE_190, "199B", 1000, 3500 },
};
-
-/* Properly close and free all devices. */
static int clear_instances(void)
{
- struct sr_dev_inst *sdi;
- struct drv_context *drvc;
- struct dev_context *devc;
- struct sr_serial_dev_inst *serial;
- GSList *l;
-
- if (!(drvc = di->priv))
- return SR_OK;
-
- drvc = di->priv;
- for (l = drvc->instances; l; l = l->next) {
- if (!(sdi = l->data))
- continue;
- if (!(devc = sdi->priv))
- continue;
- serial = sdi->conn;
- sr_serial_dev_inst_free(serial);
- sr_dev_inst_free(sdi);
- }
- g_slist_free(drvc->instances);
- drvc->instances = NULL;
-
- return SR_OK;
+ return std_dev_clear(di, NULL);
}
static int init(struct sr_context *sr_ctx)
return NULL;
}
devc->profile = &supported_flukedmm[i];
+ sdi->inst_type = SR_INST_SERIAL;
sdi->conn = serial;
sdi->priv = devc;
sdi->driver = di;
static int cleanup(void)
{
-
- clear_instances();
-
- return SR_OK;
+ return clear_instances();
}
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)