if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- if (!(devc = sdi->priv)) {
- sr_err("sdi->priv was NULL.");
- return SR_ERR_BUG;
- }
+ devc = sdi->priv;
if (!devc->ftdic) {
sr_err("devc->ftdic was NULL.");
devc->cb_data = cb_data;
- /* Send header packet to the session bus. */
std_session_send_df_header(sdi, LOG_PREFIX);
/* Time when we should be done (for detecting trigger timeouts). */
static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
{
- struct sr_datafeed_packet packet;
-
(void)cb_data;
sr_dbg("Stopping acquisition.");
sr_session_source_remove(sdi->session, -1);
-
- /* Send end packet to the session bus. */
- sr_dbg("Sending SR_DF_END.");
- packet.type = SR_DF_END;
- sr_session_send(sdi, &packet);
+ std_session_send_df_end(sdi, LOG_PREFIX);
return SR_OK;
}