#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,
const char *conn;
drvc = di->context;
- drvc->instances = NULL;
conn = NULL;
for (l = options; l; l = l->next) {
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++)
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)
usb = sdi->conn;
if (!usb->devhdl)
- /* Nothing to do. */
+ /* Nothing to do. */
return SR_OK;
libusb_release_interface(usb->devhdl, USB_INTERFACE);
(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));
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;
return SR_OK;
}
-SR_PRIV struct sr_dev_driver uni_t_ut32x_driver_info = {
+static struct sr_dev_driver uni_t_ut32x_driver_info = {
.name = "uni-t-ut32x",
.longname = "UNI-T UT32x",
.api_version = 1,
.dev_acquisition_stop = dev_acquisition_stop,
.context = NULL,
};
+SR_REGISTER_DEV_DRIVER(uni_t_ut32x_driver_info);