do_signal_trigger = 0;
if (devc->had_triggers_configured && devc->reading_behind_trigger == 0 && devc->info.n_rep_packets_before_trigger == 0) {
- sr_packet.type = SR_DF_TRIGGER;
- sr_packet.payload = NULL;
- sr_session_send(sdi, &sr_packet);
+ std_session_send_df_trigger(sdi);
devc->reading_behind_trigger = 1;
-
- do_signal_trigger = 0;
- sr_packet.type = SR_DF_LOGIC;
- sr_packet.payload = &logic;
}
for (i = 0; i < num_tfers; i++) {
n_samples = 0;
wp = (uint16_t*)devc->convbuffer;
if (do_signal_trigger) {
- sr_packet.type = SR_DF_TRIGGER;
- sr_packet.payload = NULL;
- sr_session_send(sdi, &sr_packet);
-
+ std_session_send_df_trigger(sdi);
do_signal_trigger = 0;
- sr_packet.type = SR_DF_LOGIC;
- sr_packet.payload = &logic;
}
}
p = packet->packet + k;
logic.length = n_samples * 2;
sr_session_send(sdi, &sr_packet);
if (do_signal_trigger) {
- sr_packet.type = SR_DF_TRIGGER;
- sr_packet.payload = NULL;
- sr_session_send(sdi, &sr_packet);
+ std_session_send_df_trigger(sdi);
}
}
sr_dbg("send_chunk done after %d samples", total_samples);
const struct sr_dev_inst *sdi;
struct dev_context *devc;
struct drv_context *drvc;
- struct sr_datafeed_packet packet;
struct timeval tv;
(void)fd;
return FALSE;
}
sr_dbg("retrieval is started...");
- packet.type = SR_DF_FRAME_BEGIN;
- sr_session_send(sdi, &packet);
+ std_session_send_df_frame_begin(sdi);
return TRUE;
}
if (devc->transfer_finished) {
sr_dbg("transfer is finished!");
- packet.type = SR_DF_FRAME_END;
- sr_session_send(sdi, &packet);
+ std_session_send_df_frame_end(sdi);
usb_source_remove(sdi->session, drvc->sr_ctx);
std_session_send_df_end(sdi);