]> sigrok.org Git - libsigrok.git/commitdiff
scpi: Accept *IDN responses with more than four tokens
authorAlexandru Gagniuc <redacted>
Thu, 16 Apr 2015 04:30:10 +0000 (21:30 -0700)
committerBert Vermeulen <redacted>
Wed, 29 Apr 2015 20:59:56 +0000 (22:59 +0200)
Some devices with more than one microcontroller report the firmware
version for each of them, giving us more than four tokens. When that
happens, sigrok aborts, even though it received a valid response.

This happens, for example with the Chroma 61604:
'Chroma ATE,61604,001060,1.25,1.34,1.20'

src/scpi/scpi.c

index 52fe76ddbb13bdc423663ed1ab6cd86e01138d82..c3ef6ff74c4b9527f7080beca92f5cc8dcddabe6 100644 (file)
@@ -735,7 +735,7 @@ SR_PRIV int sr_scpi_get_hw_id(struct sr_scpi_dev_inst *scpi,
 
        for (num_tokens = 0; tokens[num_tokens] != NULL; num_tokens++);
 
-       if (num_tokens != 4) {
+       if (num_tokens < 4) {
                sr_dbg("IDN response not according to spec: %80.s.", response);
                g_strfreev(tokens);
                g_free(response);