]> sigrok.org Git - libsigrok.git/blobdiff - src/scpi/scpi.c
uni-t-ut32x: use ASCII literals in packet parser, symbols for magic numbers
[libsigrok.git] / src / scpi / scpi.c
index a01e13e037da3575b37c42e935dc5cb91e932cdd..62e81bebeedab94822786daa317a6d7151b8bdcf 100644 (file)
 #define SCPI_READ_RETRY_TIMEOUT_US (10 * 1000)
 
 static const char *scpi_vendors[][2] = {
-       { "HEWLETT-PACKARD", "HP" },
        { "Agilent Technologies", "Agilent" },
-       { "RIGOL TECHNOLOGIES", "Rigol" },
-       { "PHILIPS", "Philips" },
        { "CHROMA", "Chroma" },
        { "Chroma ATE", "Chroma" },
+       { "HEWLETT-PACKARD", "HP" },
+       { "Keysight Technologies", "Keysight" },
+       { "PHILIPS", "Philips" },
+       { "RIGOL TECHNOLOGIES", "Rigol" },
 };
 
 /**
@@ -1091,9 +1092,7 @@ SR_PRIV int sr_scpi_get_hw_id(struct sr_scpi_dev_inst *scpi,
         * model, serial number of the instrument and the firmware version.
         */
        tokens = g_strsplit(response, ",", 0);
-
-       for (num_tokens = 0; tokens[num_tokens] != NULL; num_tokens++);
-
+       num_tokens = g_strv_length(tokens);
        if (num_tokens < 4) {
                sr_dbg("IDN response not according to spec: %80.s.", response);
                g_strfreev(tokens);