]> sigrok.org Git - libsigrok.git/commitdiff
chronovu-la: Show errors other than "device not found".
authorUwe Hermann <redacted>
Wed, 2 Apr 2014 16:23:23 +0000 (18:23 +0200)
committerUwe Hermann <redacted>
Sun, 13 Apr 2014 16:57:53 +0000 (18:57 +0200)
This can be useful for the user to see, e.g. for permission related
issues (device is there, but cannot be accessed).

hardware/chronovu-la/api.c

index d258d370054a4745b6d1db70c818faf3b28a86e0..b232a10b966a3b31964a43308167a130a5006edb 100644 (file)
@@ -168,8 +168,12 @@ static GSList *scan(GSList *options)
        for (i = 0; i < ARRAY_SIZE(vid_pid); i++) {
                ret = ftdi_usb_open_desc(ftdic, vid_pid[i].vid,
                        vid_pid[i].pid, vid_pid[i].iproduct, NULL);
+               /* Show errors other than "device not found". */
+               if (ret < 0 && ret != -3)
+                       sr_dbg("Error finding/opening device (%d): %s.",
+                              ret, ftdi_get_error_string(ftdic));
                if (ret < 0)
-                       continue; /* No device found. */
+                       continue; /* No device found, or not usable. */
 
                sr_dbg("Found %s device (%04x:%04x).",
                       vid_pid[i].iproduct, vid_pid[i].vid, vid_pid[i].pid);