+ case SR_CONF_LIMIT_FRAMES:
+ devc->frame_limit = g_variant_get_uint64(data);
+ ret = SR_OK;
+ break;
+ case SR_CONF_TRIGGER_SOURCE:
+ tmp = g_variant_get_string(data, NULL);
+ for (i = 0; (*model->trigger_sources)[i]; i++) {
+ if (g_strcmp0(tmp, (*model->trigger_sources)[i]) != 0)
+ continue;
+ state->trigger_source = i;
+ g_snprintf(command, sizeof(command),
+ (*model->scpi_dialect)[SCPI_CMD_SET_TRIGGER_SOURCE],
+ (*model->trigger_sources)[i]);
+
+ ret = sr_scpi_send(sdi->conn, command);
+ break;
+ }
+ break;
+ case SR_CONF_VDIV:
+ if (pg_type == PG_NONE) {
+ sr_err("No probe group specified.");
+ return SR_ERR_PROBE_GROUP;
+ }
+
+ g_variant_get(data, "(tt)", &p, &q);
+
+ for (i = 0; i < model->num_vdivs; i++) {
+ if (p != (*model->vdivs)[i][0] ||
+ q != (*model->vdivs)[i][1])
+ continue;
+ for (j = 1; j <= model->analog_channels; ++j) {
+ if (probe_group != &devc->analog_groups[j - 1])
+ continue;
+ state->analog_channels[j - 1].vdiv = (float) p / q;
+ g_snprintf(command, sizeof(command),
+ (*model->scpi_dialect)[SCPI_CMD_SET_VERTICAL_DIV],
+ j, state->analog_channels[j-1].vdiv);
+
+ if (sr_scpi_send(sdi->conn, command) != SR_OK ||
+ sr_scpi_get_opc(sdi->conn) != SR_OK)
+ return SR_ERR;
+
+ break;
+ }
+
+ ret = SR_OK;
+ break;
+ }
+ break;
+ case SR_CONF_TIMEBASE:
+ g_variant_get(data, "(tt)", &p, &q);
+
+ for (i = 0; i < model->num_timebases; i++) {
+ if (p != (*model->timebases)[i][0] ||
+ q != (*model->timebases)[i][1])
+ continue;
+ state->timebase = (float) p / q;
+ g_snprintf(command, sizeof(command),
+ (*model->scpi_dialect)[SCPI_CMD_SET_TIMEBASE],
+ state->timebase);
+
+ ret = sr_scpi_send(sdi->conn, command);
+ break;
+ }
+ 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 - 0.5) * state->timebase * model->num_xdivs;
+ g_snprintf(command, sizeof(command),
+ (*model->scpi_dialect)[SCPI_CMD_SET_HORIZ_TRIGGERPOS],
+ state->horiz_triggerpos);
+
+ ret = sr_scpi_send(sdi->conn, command);
+ break;
+ case SR_CONF_TRIGGER_SLOPE:
+ tmp_u64 = g_variant_get_uint64(data);
+
+ if (tmp_u64 != 0 && tmp_u64 != 1)
+ return SR_ERR;
+
+ state->trigger_slope = tmp_u64;
+
+ g_snprintf(command, sizeof(command),
+ (*model->scpi_dialect)[SCPI_CMD_SET_TRIGGER_SLOPE],
+ tmp_u64 ? "POS" : "NEG");
+
+ ret = sr_scpi_send(sdi->conn, command);
+ break;
+ case SR_CONF_COUPLING:
+ if (pg_type == PG_NONE) {
+ sr_err("No probe group specified.");
+ return SR_ERR_PROBE_GROUP;
+ }
+
+ tmp = g_variant_get_string(data, NULL);
+
+ for (i = 0; (*model->coupling_options)[i]; i++) {
+ if (strcmp(tmp, (*model->coupling_options)[i]) != 0)
+ continue;
+ for (j = 1; j <= model->analog_channels; ++j) {
+ if (probe_group != &devc->analog_groups[j - 1])
+ continue;
+ state->analog_channels[j-1].coupling = i;
+
+ g_snprintf(command, sizeof(command),
+ (*model->scpi_dialect)[SCPI_CMD_SET_COUPLING],
+ j, tmp);
+
+ if (sr_scpi_send(sdi->conn, command) != SR_OK ||
+ sr_scpi_get_opc(sdi->conn) != SR_OK)
+ return SR_ERR;
+ break;
+ }
+
+ ret = SR_OK;
+ break;
+ }
+ break;