siglent_sds_get_dev_cfg_horizontal(sdi);
data = g_variant_new_uint64(devc->samplerate);
break;
+ case SR_CONF_AVERAGING:
+ devc->average_enabled = g_variant_get_boolean(data);
+ sr_dbg("%s averaging", devc->average_enabled ? "Enabling" : "Disabling");
+ break;
+ case SR_CONF_AVG_SAMPLES:
+ devc->average_samples = g_variant_get_uint64(data);
+ sr_dbg("Setting averaging rate to %" PRIu64, devc->average_samples);
+ break;
default:
return SR_ERR_NA;
}
*data = g_variant_new_int32(devc->model->series->num_horizontal_divs);
break;
case SR_CONF_AVERAGING:
- /* TODO: Implement averaging. */
+ *data = g_variant_new_boolean(devc->average_enabled);
break;
default:
return SR_ERR_NA;
case SPO_MODEL:
if (siglent_sds_config_set(sdi, "WFSU SP,0,TYPE,1") != SR_OK)
return SR_ERR;
- if (siglent_sds_config_set(sdi, "ACQW SAMPLING") != SR_OK)
- return SR_ERR;
+ if (devc->average_enabled) {
+ if (siglent_sds_config_set(sdi, "ACQW AVERAGE,%i", devc->average_samples) != SR_OK)
+ return SR_ERR;
+ } else {
+ if (siglent_sds_config_set(sdi, "ACQW SAMPLING") != SR_OK)
+ return SR_ERR;
+ }
break;
case NON_SPO_MODEL:
/* TODO: Implement CML/CNL/DL models. */
/* Acquisition settings */
GSList *enabled_channels;
uint64_t limit_frames;
+ uint64_t average_samples;
+ gboolean average_enabled;
enum data_source data_source;
uint64_t analog_frame_size;
uint64_t digital_frame_size;