]> sigrok.org Git - sigrok-cli.git/commitdiff
add SR_HWCAP_DEMO_DEVICE capability
authorAnatoly Sokolov <redacted>
Sat, 21 Jan 2012 14:34:11 +0000 (18:34 +0400)
committerBert Vermeulen <redacted>
Sat, 21 Jan 2012 14:56:29 +0000 (15:56 +0100)
parsers.c
sigrok-cli.c

index b895825030b9052433eebaf1f6c443dc02b19eb2..2dbbd930095be243ef5fc71d44af31857ad58b35 100644 (file)
--- 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) {
index fa29c6c6229de31f80377d7af96c7869e719dd56..bfc21dfb2e4e47288ebd71238540cbe2104cfe85 100644 (file)
@@ -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++;
        }