]> sigrok.org Git - libsigrok.git/commitdiff
scpi: scpi_cmd_resp() shouldn't return SR_OK without filling the gvar
authorAurelien Jacobs <redacted>
Sun, 20 Sep 2015 14:15:01 +0000 (16:15 +0200)
committerAurelien Jacobs <redacted>
Sun, 20 Sep 2015 14:15:01 +0000 (16:15 +0200)
scpi-pps at line 212 assumes that an SR_OK return means that the gvar
is valid, which leads to the following error:
** GLib:ERROR:/build/glib2.0-2.45.8/./glib/gvarianttypeinfo.c:184:g_variant_type_info_check: assertion failed: (0 <= index && index < 24)

src/scpi/helpers.c

index 9efa10c5f08a93357848e61bf4a5c6f5b9720d01..c686390ffb62c0f524f3783ffa7bac2a1405102d 100644 (file)
@@ -97,8 +97,8 @@ SR_PRIV int scpi_cmd_resp(const struct sr_dev_inst *sdi, const struct scpi_comma
        const char *cmd;
 
        if (!(cmd = scpi_cmd_get(cmdtable, command))) {
-               /* Device does not implement this command, that's OK. */
-               return SR_OK;
+               /* Device does not implement this command. */
+               return SR_ERR_NA;
        }
 
        scpi = sdi->conn;