+ case SR_CONF_LIMIT_FRAMES:
+ devc->frame_limit = g_variant_get_uint64(data);
+ ret = SR_OK;
+ break;
+ case SR_CONF_TRIGGER_SOURCE:
+ if ((idx = std_str_idx(data, *model->trigger_sources, model->num_trigger_sources)) < 0)
+ return SR_ERR_ARG;
+ state->trigger_source = idx;
+ g_snprintf(command, sizeof(command),
+ "TRIG_SELECT EDGE,SR,%s", (*model->trigger_sources)[idx]);
+ ret = sr_scpi_send(sdi->conn, command);
+ break;
+ case SR_CONF_VDIV:
+ if ((idx = std_u64_tuple_idx(data, *model->vdivs, model->num_vdivs)) < 0)
+ return SR_ERR_ARG;
+ if ((j = std_cg_idx(cg, devc->analog_groups, model->analog_channels)) < 0)
+ return SR_ERR_ARG;
+ state->analog_channels[j].vdiv = idx;
+ g_snprintf(command, sizeof(command),
+ "C%d:VDIV %E", j + 1, (float) (*model->vdivs)[idx][0] / (*model->vdivs)[idx][1]);
+ if (sr_scpi_send(sdi->conn, command) != SR_OK || sr_scpi_get_opc(sdi->conn) != SR_OK)
+ return SR_ERR;
+ ret = SR_OK;
+ break;
+ case SR_CONF_TIMEBASE:
+ if ((idx = std_u64_tuple_idx(data, *model->timebases, model->num_timebases)) < 0)
+ return SR_ERR_ARG;
+ state->timebase = idx;
+ g_snprintf(command, sizeof(command),
+ "TIME_DIV %E", (float) (*model->timebases)[idx][0] / (*model->timebases)[idx][1]);
+ ret = sr_scpi_send(sdi->conn, command);
+ break;
+ case SR_CONF_HORIZ_TRIGGERPOS:
+ tmp_d = g_variant_get_double(data);
+
+ if (tmp_d < 0.0 || tmp_d > 1.0)
+ return SR_ERR;
+
+ state->horiz_triggerpos = tmp_d;
+ tmp_d = -(tmp_d - 0.5) *
+ ((double)(*model->timebases)[state->timebase][0] /
+ (*model->timebases)[state->timebase][1])
+ * model->num_xdivs;
+
+ g_snprintf(command, sizeof(command), "TRIG POS %e S", tmp_d);
+
+ ret = sr_scpi_send(sdi->conn, command);
+ break;
+ case SR_CONF_TRIGGER_SLOPE:
+ if ((idx = std_str_idx(data, *model->trigger_slopes, model->num_trigger_slopes)) < 0)
+ return SR_ERR_ARG;
+ state->trigger_slope = idx;
+ g_snprintf(command, sizeof(command),
+ "%s:TRIG_SLOPE %s", (*model->trigger_sources)[state->trigger_source],
+ (*model->trigger_slopes)[idx]);
+ ret = sr_scpi_send(sdi->conn, command);
+ break;
+ case SR_CONF_COUPLING:
+ if ((idx = std_str_idx(data, *model->coupling_options, model->num_coupling_options)) < 0)
+ return SR_ERR_ARG;
+ if ((j = std_cg_idx(cg, devc->analog_groups, model->analog_channels)) < 0)
+ return SR_ERR_ARG;
+ state->analog_channels[j].coupling = idx;
+ g_snprintf(command, sizeof(command), "C%d:COUPLING %s",
+ j + 1, (*model->coupling_options)[idx]);
+ if (sr_scpi_send(sdi->conn, command) != SR_OK || sr_scpi_get_opc(sdi->conn) != SR_OK)
+ return SR_ERR;
+ ret = SR_OK;
+ break;