]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/uni-t-ut32x/api.c
Change sr_dev_inst_new() to take no parameters.
[libsigrok.git] / src / hardware / uni-t-ut32x / api.c
index 52f0c476867b16f5c3fe0b846f2242a80352c3a2..a50d4a4fcdcb64a09c4d098b83e46fa6d98d0d67 100644 (file)
 
 #include <string.h>
 
-static const uint32_t hwcaps[] = {
+static const uint32_t devopts[] = {
        SR_CONF_THERMOMETER,
-       SR_CONF_LIMIT_SAMPLES,
        SR_CONF_CONTINUOUS,
-       SR_CONF_DATA_SOURCE,
+       SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
+       SR_CONF_DATA_SOURCE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
 };
 
 static char *channels[] = {
@@ -79,9 +79,10 @@ static GSList *scan(GSList *options)
                /* We have a list of sr_usb_dev_inst matching the connection
                 * string. Wrap them in sr_dev_inst and we're done. */
                for (l = usb_devices; l; l = l->next) {
-                       if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR,
-                                       MODEL, NULL)))
-                               return NULL;
+                       sdi = sr_dev_inst_new();
+                       sdi->status = SR_ST_INACTIVE;
+                       sdi->vendor = g_strdup(VENDOR);
+                       sdi->model = g_strdup(MODEL);
                        sdi->driver = di;
                        sdi->inst_type = SR_INST_USB;
                        sdi->conn = l->data;
@@ -275,7 +276,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
                *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
-                               hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t));
+                               devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
                break;
        case SR_CONF_DATA_SOURCE:
                *data = g_variant_new_strv(data_sources, ARRAY_SIZE(data_sources));