]> sigrok.org Git - libsigrok.git/commitdiff
ols: also reflect successful identify response in diagnostics
authorGerhard Sittig <redacted>
Fri, 13 Jan 2017 18:44:26 +0000 (19:44 +0100)
committerGerhard Sittig <redacted>
Sun, 21 Aug 2022 15:45:11 +0000 (17:45 +0200)
The ols driver's scan() routine used to present the identification
response to users when the scan failed, but would not when the scan
succeeded.

Since multiple response literals are supported, it's considered useful
to see these, too, in case of successful device detection. Emit debug
messages for developers' awareness.

src/hardware/openbench-logic-sniffer/api.c

index 67bb230d208144fe44176a33a877ba59e39ded5f..81a29fb68238f88b9081597d9f542833a9b18510 100644 (file)
@@ -161,6 +161,10 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
                sr_hexdump_free(id);
                return NULL;
+       } else {
+               sr_dbg("Successful detection, got '%c%c%c%c' (0x%02x 0x%02x 0x%02x 0x%02x).",
+                      buf[0], buf[1], buf[2], buf[3],
+                      buf[0], buf[1], buf[2], buf[3]);
        }
 
        /* Definitely using the OLS protocol, check if it supports