if (!sdi || !(devc = sdi->priv))
return SR_ERR_ARG;
+ /* If a probe group is specified, it must be a valid one. */
+ if (probe_group) {
+ if (probe_group != &devc->analog_groups[0]
+ && probe_group != &devc->analog_groups[1]) {
+ sr_err("Invalid probe group specified.");
+ return SR_ERR;
+ }
+ }
+
switch (id) {
case SR_CONF_NUM_TIMEBASE:
*data = g_variant_new_int32(NUM_TIMEBASE);
break;
case SR_CONF_NUM_VDIV:
+ if (!probe_group) {
+ sr_err("No probe group specified.");
+ return SR_ERR_PROBE_GROUP;
+ }
for (i = 0; i < 2; i++) {
if (probe_group == &devc->analog_groups[i]) {
*data = g_variant_new_int32(NUM_VDIV);
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
+ /* If a probe group is specified, it must be a valid one. */
+ if (probe_group) {
+ if (probe_group != &devc->analog_groups[0]
+ && probe_group != &devc->analog_groups[1]) {
+ sr_err("Invalid probe group specified.");
+ return SR_ERR;
+ }
+ }
+
ret = SR_OK;
switch (id) {
case SR_CONF_LIMIT_FRAMES:
ret = SR_ERR_ARG;
break;
case SR_CONF_VDIV:
+ if (!probe_group) {
+ sr_err("No probe group specified.");
+ return SR_ERR_PROBE_GROUP;
+ }
g_variant_get(data, "(tt)", &p, &q);
for (i = 0; i < 2; i++) {
if (probe_group == &devc->analog_groups[i]) {
if (!sdi || !(devc = sdi->priv))
return SR_ERR_ARG;
+ /* If a probe group is specified, it must be a valid one. */
+ if (probe_group) {
+ if (probe_group != &devc->analog_groups[0]
+ && probe_group != &devc->analog_groups[1]) {
+ sr_err("Invalid probe group specified.");
+ return SR_ERR;
+ }
+ }
+
switch (key) {
break;
case SR_CONF_DEVICE_OPTIONS:
+ if (!probe_group) {
+ sr_err("No probe group specified.");
+ return SR_ERR_PROBE_GROUP;
+ }
if (probe_group == &devc->digital_group) {
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
NULL, 0, sizeof(int32_t));
*data = g_variant_new_strv(coupling, ARRAY_SIZE(coupling));
return SR_OK;
}
+ if (!probe_group) {
+ sr_err("No probe group specified.");
+ return SR_ERR_PROBE_GROUP;
}
return SR_ERR_NA;
case SR_CONF_VDIV:
*data = g_variant_new_tuple(rational, 2);
return SR_OK;
}
+ if (!probe_group) {
+ sr_err("No probe group specified.");
+ return SR_ERR_PROBE_GROUP;
}
return SR_ERR_NA;
case SR_CONF_TIMEBASE: