X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fagilent-dmm%2Fapi.c;h=ccc2f65cd5ccaaa893c42e0f507aa6d531b0ed3d;hb=2db959063b073b87cfb45a433f2a422b594731b0;hp=cc2a4be84f58463084c35a252e15772ae4bb6d1e;hpb=854434de0bc581f16f87f85595f473ee41ca9e0c;p=libsigrok.git diff --git a/hardware/agilent-dmm/api.c b/hardware/agilent-dmm/api.c index cc2a4be8..ccc2f65c 100644 --- a/hardware/agilent-dmm/api.c +++ b/hardware/agilent-dmm/api.c @@ -61,11 +61,6 @@ static const struct agdmm_profile supported_agdmm[] = { SR_PRIV struct sr_dev_driver agdmm_driver_info; static struct sr_dev_driver *di = &agdmm_driver_info; -static int dev_clear(void) -{ - return std_dev_clear(di, NULL); -} - static int init(struct sr_context *sr_ctx) { return std_init(sr_ctx, di, LOG_PREFIX); @@ -77,7 +72,7 @@ static GSList *scan(GSList *options) struct drv_context *drvc; struct dev_context *devc; struct sr_config *src; - struct sr_probe *probe; + struct sr_channel *ch; struct sr_serial_dev_inst *serial; GSList *l, *devices; int len, i; @@ -133,7 +128,7 @@ static GSList *scan(GSList *options) for (i = 0; supported_agdmm[i].model; i++) { if (strcmp(supported_agdmm[i].modelname, tokens[1])) continue; - if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, tokens[0], + if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Agilent", tokens[1], tokens[3]))) return NULL; if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { @@ -146,9 +141,9 @@ static GSList *scan(GSList *options) sdi->conn = serial; sdi->priv = devc; sdi->driver = di; - if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) + if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1"))) return NULL; - sdi->probes = g_slist_append(sdi->probes, probe); + sdi->channels = g_slist_append(sdi->channels, ch); drvc->instances = g_slist_append(drvc->instances, sdi); devices = g_slist_append(devices, sdi); break; @@ -171,15 +166,15 @@ static GSList *dev_list(void) static int cleanup(void) { - return dev_clear(); + return std_dev_clear(di, NULL); } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *cg) { struct dev_context *devc; - (void)probe_group; + (void)cg; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -213,10 +208,10 @@ static int config_set(int id, 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) + const struct sr_channel_group *cg) { (void)sdi; - (void)probe_group; + (void)cg; switch (key) { case SR_CONF_SCAN_OPTIONS: @@ -273,7 +268,7 @@ SR_PRIV struct sr_dev_driver agdmm_driver_info = { .cleanup = cleanup, .scan = scan, .dev_list = dev_list, - .dev_clear = dev_clear, + .dev_clear = NULL, .config_get = NULL, .config_set = config_set, .config_list = config_list,