From: Uwe Hermann Date: Sun, 23 Nov 2014 20:09:37 +0000 (+0100) Subject: manson-hcs-3xxx: Fix incorrect SR_CONF_SCAN_OPTIONS handling. X-Git-Tag: libsigrok-0.4.0~714 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=b6085eb17901306b686a9269e5d2660d88561dc3;p=libsigrok.git manson-hcs-3xxx: Fix incorrect SR_CONF_SCAN_OPTIONS handling. The SR_CONF_SCAN_OPTIONS key must be listable with or without sdi, otherwise the device will not be detected by frontends. --- diff --git a/src/hardware/manson-hcs-3xxx/api.c b/src/hardware/manson-hcs-3xxx/api.c index 5f51b82c..d3e5f8fa 100644 --- a/src/hardware/manson-hcs-3xxx/api.c +++ b/src/hardware/manson-hcs-3xxx/api.c @@ -330,21 +330,26 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * (void)cg; + /* Always available (with or without sdi). */ + if (key == SR_CONF_SCAN_OPTIONS) { + *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, + scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t)); + return SR_OK; + } + + /* Return drvopts without sdi (and devopts with sdi, see below). */ if (key == SR_CONF_DEVICE_OPTIONS && !sdi) { *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, drvopts, ARRAY_SIZE(drvopts), sizeof(uint32_t)); return SR_OK; } + /* Every other key needs an sdi. */ if (!sdi) return SR_ERR_ARG; devc = sdi->priv; switch (key) { - case SR_CONF_SCAN_OPTIONS: - *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, - scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t)); - break; case SR_CONF_DEVICE_OPTIONS: *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));