return SR_ERR;
}
- sdi->status = SR_ST_ACTIVE;
-
return SR_OK;
}
struct sr_scpi_dev_inst *scpi;
struct dev_context *devc;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
scpi = sdi->conn;
devc = sdi->priv;
+ if (!scpi)
+ return SR_ERR_BUG;
+
if (devc->model->series->protocol == PROTOCOL_V2)
rigol_ds_config_set(sdi, ":KEY:LOCK DISABLE");
- if (scpi) {
- if (sr_scpi_close(scpi) < 0)
- return SR_ERR;
- sdi->status = SR_ST_INACTIVE;
- }
-
- return SR_OK;
+ return sr_scpi_close(scpi);
}
static int analog_frame_size(const struct sr_dev_inst *sdi)
devc = sdi->priv;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
/* If a channel group is specified, it must be a valid one. */
if (cg && !g_slist_find(sdi->channel_groups, cg)) {
sr_err("Invalid channel group specified.");
gboolean some_digital;
GSList *l;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
scpi = sdi->conn;
devc = sdi->priv;
devc = sdi->priv;
- if (sdi->status != SR_ST_ACTIVE) {
- sr_err("Device inactive, can't stop acquisition.");
- return SR_ERR;
- }
-
std_session_send_df_end(sdi);
g_slist_free(devc->enabled_channels);