]> sigrok.org Git - libsigrok.git/commitdiff
scpi-pps: sr_scpi_get_string() is already called by scpi_cmd_resp()
authorAurelien Jacobs <redacted>
Sun, 20 Sep 2015 14:22:21 +0000 (16:22 +0200)
committerAurelien Jacobs <redacted>
Sun, 20 Sep 2015 14:22:21 +0000 (16:22 +0200)
This double call was causing the following error:
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.

src/hardware/scpi-pps/api.c

index fbc71ceef217e1b4b920f0406fbcdc597c1a943d..294c5a0e8e4617c8cb4f15715169347b7bcccf51 100644 (file)
@@ -365,8 +365,7 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s
                 * return VOLT/CURR. We always return a GVariant string in
                 * the Rigol notation.
                 */
-               if ((ret = sr_scpi_get_string(sdi->conn, NULL, &s)) != SR_OK)
-                       return ret;
+               s = g_variant_get_string(*data, NULL);
                if (!strcmp(s, "CV") || !strcmp(s, "VOLT")) {
                        *data = g_variant_new_string("CV");
                } else if (!strcmp(s, "CC") || !strcmp(s, "CURR")) {