+ if (analog.num_samples == 0) {
+ g_free(analog.data);
+
+ /* No data available, we have to acquire data first. */
+ g_snprintf(command, sizeof(command), "ARM;WAIT;*OPC;C%d:WAVEFORM?", ch->index + 1);
+ sr_scpi_send(sdi->conn, command);
+
+ state->sample_rate = 0;
+ return TRUE;
+ } else {
+ /* Update sample rate if needed. */
+ if (state->sample_rate == 0)
+ if (lecroy_xstream_update_sample_rate(sdi, analog.num_samples) != SR_OK) {
+ g_free(analog.data);
+ return SR_ERR;
+ }
+ }
+
+ /*
+ * Send "frame begin" packet upon reception of data for the
+ * first enabled channel.
+ */
+ if (devc->current_channel == devc->enabled_channels)
+ std_session_send_df_frame_begin(sdi);
+