X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Funi-t-ut32x%2Fapi.c;h=25f142b49d9da9a9ff60cacbf430c89c21b50c42;hb=40bbf635fadac32d1e702f02fe571d95338d582b;hp=147ac7dfe6f041be7b3e4d24d6bf7ef028fdc885;hpb=566007e15e8ec0a23b064ba8ea44baae305508b5;p=libsigrok.git diff --git a/src/hardware/uni-t-ut32x/api.c b/src/hardware/uni-t-ut32x/api.c index 147ac7df..25f142b4 100644 --- a/src/hardware/uni-t-ut32x/api.c +++ b/src/hardware/uni-t-ut32x/api.c @@ -21,6 +21,10 @@ #include #include "protocol.h" +static const uint32_t scanopts[] = { + SR_CONF_CONN, +}; + static const uint32_t devopts[] = { SR_CONF_THERMOMETER, SR_CONF_CONTINUOUS, @@ -70,7 +74,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) 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; for (i = 0; i < ARRAY_SIZE(channel_names); i++) @@ -80,14 +83,13 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sdi->priv = devc; devc->limit_samples = 0; devc->data_source = DEFAULT_DATA_SOURCE; - drvc->instances = g_slist_append(drvc->instances, sdi); devices = g_slist_append(devices, sdi); } g_slist_free(usb_devices); } else g_slist_free_full(usb_devices, g_free); - return devices; + return std_scan_complete(di, devices); } static int dev_open(struct sr_dev_inst *sdi) @@ -136,7 +138,7 @@ static int dev_close(struct sr_dev_inst *sdi) usb = sdi->conn; if (!usb->devhdl) - /* Nothing to do. */ + /* Nothing to do. */ return SR_OK; libusb_release_interface(usb->devhdl, USB_INTERFACE); @@ -212,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)); @@ -256,7 +262,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) return SR_ERR; } - std_session_send_df_header(sdi, LOG_PREFIX); + std_session_send_df_header(sdi); if (!(devc->xfer = libusb_alloc_transfer(0))) return SR_ERR;