From: Anatoly Sokolov Date: Sat, 21 Jan 2012 14:34:11 +0000 (+0400) Subject: add SR_HWCAP_DEMO_DEVICE capability X-Git-Tag: sigrok-cli-0.3.0~62 X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=commitdiff_plain;h=350beb4bff20be4fd766715a75d69989f301ede3 add SR_HWCAP_DEMO_DEVICE capability --- diff --git a/parsers.c b/parsers.c index b895825..2dbbd93 100644 --- a/parsers.c +++ b/parsers.c @@ -147,7 +147,7 @@ struct sr_device *parse_devicestring(const char *devicestring) devices = sr_device_list(); for (l = devices; l; l = l->next) { d = l->data; - if (strstr(d->plugin->name, "demo")) + if (sr_device_has_hwcap(d, SR_HWCAP_DEMO_DEVICE)) continue; if (device_cnt == device_num) { if (device_num == device_cnt) { diff --git a/sigrok-cli.c b/sigrok-cli.c index fa29c6c..bfc21df 100644 --- a/sigrok-cli.c +++ b/sigrok-cli.c @@ -159,7 +159,7 @@ static void show_device_list(void) demo_device = NULL; for (l = devices; l; l = l->next) { device = l->data; - if (strstr(device->plugin->name, "demo")) { + if (sr_device_has_hwcap(device, SR_HWCAP_DEMO_DEVICE)) { demo_device = device; continue; } @@ -710,7 +710,7 @@ int num_real_devices(void) devices = sr_device_list(); for (l = devices; l; l = l->next) { device = l->data; - if (!strstr(device->plugin->name, "demo")) + if (!sr_device_has_hwcap(device, SR_HWCAP_DEMO_DEVICE)) num_devices++; }