From: Uwe Hermann Date: Fri, 22 Nov 2013 18:56:20 +0000 (+0100) Subject: ols: config_list(): Handle SR_CONF_PATTERN_MODE. X-Git-Tag: libsigrok-0.3.0~538 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=7c07a1783e62dc76bce6238fb3a54160aefedbc3;p=libsigrok.git ols: config_list(): Handle SR_CONF_PATTERN_MODE. SR_CONF_PATTERN_MODE was not handled in config_list(), yielding non-working OLS support in PulseView (due to an assert), and a missing pattern list in sigrok-cli's --show output. This fixes bug #184. --- diff --git a/hardware/openbench-logic-sniffer/api.c b/hardware/openbench-logic-sniffer/api.c index 0d76a7fc..a38bbf83 100644 --- a/hardware/openbench-logic-sniffer/api.c +++ b/hardware/openbench-logic-sniffer/api.c @@ -53,6 +53,11 @@ enum { PATTERN_INTERNAL, }; +static const char *patterns[] = { + STR_PATTERN_EXTERNAL, + STR_PATTERN_INTERNAL, +}; + /* Probes are numbered 0-31 (on the PCB silkscreen). */ SR_PRIV const char *ols_probe_names[NUM_PROBES + 1] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", @@ -388,6 +393,9 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, case SR_CONF_TRIGGER_TYPE: *data = g_variant_new_string(TRIGGER_TYPE); break; + case SR_CONF_PATTERN_MODE: + *data = g_variant_new_strv(patterns, ARRAY_SIZE(patterns)); + break; default: return SR_ERR_NA; }