+
+ // Set the sample limit
+ if (sr_config_set(sdi, SR_CONF_LIMIT_SAMPLES,
+ g_variant_new_uint64(record_length)) != SR_OK) {
+ error_handler(tr("Failed to configure "
+ "time-based sample limit."));
+ sr_session_destroy();
+ return;
+ }
+
+ if (sr_session_start() != SR_OK) {
+ error_handler(tr("Failed to start session."));
+ return;
+ }
+
+ set_capture_state(Running);
+
+ sr_session_run();
+ sr_session_destroy();
+
+ set_capture_state(Stopped);
+
+ // Confirm that SR_DF_END was received
+ assert(!_cur_logic_snapshot);
+ assert(!_cur_analog_snapshot);
+}
+
+void SigSession::feed_in_header(const sr_dev_inst *sdi)
+{
+ GVariant *gvar;
+ uint64_t sample_rate = 0;
+
+ // Read out the sample rate
+ if(sdi->driver)
+ {
+ const int ret = sr_config_get(sdi->driver,
+ SR_CONF_SAMPLERATE, &gvar, sdi);
+ if (ret != SR_OK) {
+ qDebug("Failed to get samplerate\n");
+ return;
+ }
+
+ sample_rate = g_variant_get_uint64(gvar);
+ g_variant_unref(gvar);
+ }
+
+ if(_analog_data)
+ _analog_data->set_samplerate(sample_rate);
+ if(_logic_data)
+ _logic_data->set_samplerate(sample_rate);