SR_CONF_SAMPLERATE | SR_CONF_GET,
};
-SR_PRIV struct sr_dev_driver gwinstek_gds_800_driver_info;
+static struct sr_dev_driver gwinstek_gds_800_driver_info;
static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
{
devc = g_malloc0(sizeof(struct dev_context));
devc->frame_limit = 1;
- devc->sample_rate = 0.;
- devc->df_started = FALSE;
+ devc->sample_rate = 0.0;
+ devc->df_started = FALSE;
sdi->priv = devc;
sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "CH1");
(void)cg;
- if (!sdi || !(devc = sdi->priv))
+ if (!sdi)
return SR_ERR_ARG;
+ devc = sdi->priv;
+
switch (key) {
case SR_CONF_SAMPLERATE:
*data = g_variant_new_uint64(devc->sample_rate);
if (!sdi)
return SR_ERR_ARG;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
devc = sdi->priv;
switch (key) {
scpi = sdi->conn;
devc = sdi->priv;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
devc->state = START_ACQUISITION;
devc->cur_acq_frame = 0;
scpi = sdi->conn;
devc = sdi->priv;
- if (sdi->status != SR_ST_ACTIVE) {
- sr_err("Device inactive, can't stop acquisition.");
- return SR_ERR;
- }
-
if (devc->df_started) {
packet.type = SR_DF_FRAME_END;
sr_session_send(sdi, &packet);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
devc->df_started = FALSE;
}
return SR_OK;
}
-SR_PRIV struct sr_dev_driver gwinstek_gds_800_driver_info = {
+static struct sr_dev_driver gwinstek_gds_800_driver_info = {
.name = "gwinstek-gds-800",
.longname = "GW Instek GDS-800 series",
.api_version = 1,
.dev_acquisition_stop = dev_acquisition_stop,
.context = NULL,
};
+SR_REGISTER_DEV_DRIVER(gwinstek_gds_800_driver_info);