]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/uni-t-ut32x/api.c
Add sr_dev_acquisition_stop(), factor out SR_ERR_DEV_CLOSED check.
[libsigrok.git] / src / hardware / uni-t-ut32x / api.c
index da53be9e6161afa10f1da758a711b76b3a8ad2a5..2df113c322f3e6017777d51a343f99cc5b4f0476 100644 (file)
 #include <string.h>
 #include "protocol.h"
 
+static const uint32_t scanopts[] = {
+       SR_CONF_CONN,
+};
+
 static const uint32_t devopts[] = {
        SR_CONF_THERMOMETER,
        SR_CONF_CONTINUOUS,
@@ -210,6 +214,10 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
        (void)cg;
 
        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));
@@ -288,9 +296,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 
 static int dev_acquisition_stop(struct sr_dev_inst *sdi)
 {
-       if (sdi->status != SR_ST_ACTIVE)
-               return SR_ERR_DEV_CLOSED;
-
        /* Signal USB transfer handler to clean up and stop. */
        sdi->status = SR_ST_STOPPING;