]> sigrok.org Git - libsigrok.git/commitdiff
rigol-ds: handle full word trigger slope in config_get().
authorAurelien Jacobs <redacted>
Fri, 13 Feb 2015 15:37:24 +0000 (16:37 +0100)
committerAurelien Jacobs <redacted>
Fri, 13 Feb 2015 15:37:24 +0000 (16:37 +0100)
Some scope can return POSITIVE/NEGATIVE instead of POS/NEG,
so accept this as well.

This closes bug #558.

src/hardware/rigol-ds/api.c

index b9b8a7d5c92d63aaeb00991991ef5fa604cb8ffd..da1d8fb0618c67cda6ced439eb7a19e5c760948a 100644 (file)
@@ -557,9 +557,9 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s
                *data = g_variant_new_string(tmp_str);
                break;
        case SR_CONF_TRIGGER_SLOPE:
-               if (!strcmp(devc->trigger_slope, "POS"))
+               if (!strncmp(devc->trigger_slope, "POS", 3))
                        tmp_str = "r";
-               else if (!strcmp(devc->trigger_slope, "NEG"))
+               else if (!strncmp(devc->trigger_slope, "NEG", 3))
                        tmp_str = "f";
                else
                        return SR_ERR_NA;