static int dev_acquisition_stop(struct sr_dev_inst *sdi);
-static struct sr_dev_inst *dso_dev_new(struct sr_dev_driver *di,
- const struct dso_profile *prof)
+static struct sr_dev_inst *dso_dev_new(const struct dso_profile *prof)
{
struct sr_dev_inst *sdi;
struct sr_channel *ch;
struct sr_channel_group *cg;
- struct drv_context *drvc;
struct dev_context *devc;
unsigned int i;
sdi->status = SR_ST_INITIALIZING;
sdi->vendor = g_strdup(prof->vendor);
sdi->model = g_strdup(prof->model);
- sdi->driver = di;
/*
* Add only the real channels -- EXT isn't a source of data, only
devc->triggersource = g_strdup(DEFAULT_TRIGGER_SOURCE);
devc->triggerposition = DEFAULT_HORIZ_TRIGGERPOS;
sdi->priv = devc;
- drvc = di->context;
- drvc->instances = g_slist_append(drvc->instances, sdi);
return sdi;
}
/* Device matches the pre-firmware profile. */
prof = &dev_profiles[j];
sr_dbg("Found a %s %s.", prof->vendor, prof->model);
- sdi = dso_dev_new(di, prof);
+ sdi = dso_dev_new(prof);
sdi->connection_id = g_strdup(connection_id);
devices = g_slist_append(devices, sdi);
devc = sdi->priv;
/* Device matches the post-firmware profile. */
prof = &dev_profiles[j];
sr_dbg("Found a %s %s.", prof->vendor, prof->model);
- sdi = dso_dev_new(di, prof);
+ sdi = dso_dev_new(prof);
sdi->connection_id = g_strdup(connection_id);
sdi->status = SR_ST_INACTIVE;
devices = g_slist_append(devices, sdi);
}
libusb_free_device_list(devlist, 1);
- return devices;
+ return std_scan_complete(di, devices);
}
static int dev_open(struct sr_dev_inst *sdi)
*/
usb_source_remove(sdi->session, drvc->sr_ctx);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
devc->dev_state = IDLE;
devc->dev_state = CAPTURE;
usb_source_add(sdi->session, drvc->sr_ctx, TICK, handle_event, (void *)sdi);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
return SR_OK;
}
return SR_OK;
}
-SR_PRIV struct sr_dev_driver hantek_dso_driver_info = {
+static struct sr_dev_driver hantek_dso_driver_info = {
.name = "hantek-dso",
.longname = "Hantek DSO",
.api_version = 1,
.dev_acquisition_stop = dev_acquisition_stop,
.context = NULL,
};
+SR_REGISTER_DEV_DRIVER(hantek_dso_driver_info);