]> sigrok.org Git - libsigrok.git/blobdiff - hardware/sysclk-lwla/api.c
sysclk-lwla: Advertise SR_CONF_CONN option.
[libsigrok.git] / hardware / sysclk-lwla / api.c
index 5b9f4330b75682271b82eb44ff23a27a07733c1f..5bae5d5499225e9b1d39c60641ba7b3e66a353a1 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
+static const int32_t hwopts[] = {
+       SR_CONF_CONN,
+};
+
 static const int32_t hwcaps[] = {
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
@@ -287,7 +291,6 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        switch (key) {
        case SR_CONF_SAMPLERATE:
                value = g_variant_get_uint64(data);
-               sr_info("Setting samplerate %" PRIu64, value);
                if (value < samplerates[G_N_ELEMENTS(samplerates) - 1]
                                || value > samplerates[0])
                        return SR_ERR_SAMPLERATE;
@@ -334,14 +337,18 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
        (void)probe_group;
 
        switch (key) {
+       case SR_CONF_SCAN_OPTIONS:
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
+                               hwopts, G_N_ELEMENTS(hwopts), sizeof(int32_t));
+               break;
        case SR_CONF_DEVICE_OPTIONS:
                *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t));
+                               hwcaps, G_N_ELEMENTS(hwcaps), sizeof(int32_t));
                break;
        case SR_CONF_SAMPLERATE:
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
                gvar = g_variant_new_fixed_array(G_VARIANT_TYPE("t"),
-                               samplerates, ARRAY_SIZE(samplerates),
+                               samplerates, G_N_ELEMENTS(samplerates),
                                sizeof(uint64_t));
                g_variant_builder_add(&gvb, "{sv}", "samplerates", gvar);
                *data = g_variant_builder_end(&gvb);