X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=blobdiff_plain;f=device.c;h=90c9fc349449d0e0e183cddf1e333adecd1b687c;hp=a7dfe62d57166a08eb40aae5fc81e8f43f6d5eba;hb=a8b4041ad4829aeb33e243d6a6a0c482be4658cd;hpb=ad54a1a630e6887204bc57a95075f403fd44aa6c diff --git a/device.c b/device.c index a7dfe62..90c9fc3 100644 --- a/device.c +++ b/device.c @@ -20,10 +20,9 @@ #include "sigrok-cli.h" #include "config.h" #include +#include extern struct sr_context *sr_ctx; -extern gchar *opt_drv; -extern gchar *opt_probe_group; /* Convert driver options hash to GSList of struct sr_config. */ static GSList *hash_to_hwopt(GHashTable *hash) @@ -115,23 +114,23 @@ GSList *device_scan(void) return devices; } -struct sr_probe_group *select_probe_group(struct sr_dev_inst *sdi) +struct sr_channel_group *select_channel_group(struct sr_dev_inst *sdi) { - struct sr_probe_group *pg; + struct sr_channel_group *cg; GSList *l; - if (!opt_probe_group) + if (!opt_channel_group) return NULL; - if (!sdi->probe_groups) { - g_critical("This device does not have any probe groups."); + if (!sdi->channel_groups) { + g_critical("This device does not have any channel groups."); return NULL; } - for (l = sdi->probe_groups; l; l = l->next) { - pg = l->data; - if (!strcasecmp(opt_probe_group, pg->name)) { - return pg; + for (l = sdi->channel_groups; l; l = l->next) { + cg = l->data; + if (!strcasecmp(opt_channel_group, cg->name)) { + return cg; } }