"Memory",
};
-SR_PRIV struct sr_dev_driver kecheng_kc_330b_driver_info;
-
-static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
-{
- return std_init(sr_ctx, di, LOG_PREFIX);
-}
-
static int scan_kecheng(struct sr_dev_driver *di,
struct sr_usb_dev_inst *usb, char **model)
{
(void)options;
drvc = di->context;
- drvc->instances = NULL;
devices = NULL;
if ((usb_devices = sr_usb_find(drvc->sr_ctx->libusb_ctx, USB_CONN))) {
sdi->status = SR_ST_INACTIVE;
sdi->vendor = g_strdup(VENDOR);
sdi->model = model; /* Already g_strndup()'d. */
- sdi->driver = di;
sdi->inst_type = SR_INST_USB;
sdi->conn = l->data;
sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "SPL");
/* TODO: Set date/time? */
- 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;
/* This allows a frontend to configure the device without ever
devc->num_samples = 0;
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
if (devc->data_source == DATA_SOURCE_LIVE) {
/* Force configuration. */
devc->stored_samples = (buf[7] << 8) | buf[8];
if (devc->stored_samples == 0) {
/* Notify frontend of empty log by sending start/end packets. */
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
return SR_OK;
}
return SR_OK;
}
-SR_PRIV struct sr_dev_driver kecheng_kc_330b_driver_info = {
+static struct sr_dev_driver kecheng_kc_330b_driver_info = {
.name = "kecheng-kc-330b",
.longname = "Kecheng KC-330B",
.api_version = 1,
- .init = init,
+ .init = std_init,
.cleanup = std_cleanup,
.scan = scan,
.dev_list = std_dev_list,
.dev_acquisition_stop = dev_acquisition_stop,
.context = NULL,
};
+SR_REGISTER_DEV_DRIVER(kecheng_kc_330b_driver_info);