]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/hameg-hmo/api.c
output: Allocate additional memory for NULL terminator.
[libsigrok.git] / src / hardware / hameg-hmo / api.c
index ff045f16425e61ad091be85868c2111845cb39fe..7f3d5f549321e0cc6025ee16f7a20624b3da1e44 100644 (file)
@@ -29,7 +29,7 @@ static const char *manufacturers[] = {
        "HAMEG",
 };
 
-static const int32_t hwopts[] = {
+static const int32_t scanopts[] = {
        SR_CONF_CONN,
        SR_CONF_SERIALCOMM,
 };
@@ -519,6 +519,10 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
        model = devc->model_config;
 
        switch (key) {
+       case SR_CONF_SCAN_OPTIONS:
+               *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
+                               scanopts, ARRAY_SIZE(scanopts), sizeof(int32_t));
+               break;
        case SR_CONF_DEVICE_OPTIONS:
                if (cg_type == CG_NONE) {
                        *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
@@ -723,6 +727,9 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        devc = sdi->priv;
        digital_added = FALSE;
 
+       g_slist_free(devc->enabled_channels);
+       devc->enabled_channels = NULL;
+
        for (l = sdi->channels; l; l = l->next) {
                ch = l->data;
                if (!ch->enabled)