- devc->limit_samples = g_variant_get_uint64(data);
- sr_dbg("Setting sample limit to %" PRIu64 ".",
- devc->limit_samples);
- break;
- case SR_CONF_OUTPUT_CHANNEL_CONFIG:
- sval = g_variant_get_string(data, NULL);
- found = FALSE;
- for (idx = 0; idx < (int)ARRAY_SIZE(channel_modes); idx++)
- {
- if (!strcmp(sval, channel_modes[idx])) {
- found = TRUE;
- if (devc->tracking_mode == idx)
- break; /* Nothing to do! */
- devc->tracking_mode = idx;
- if (devc->model->modelid >= LPS_304) /* No use to set anything in the smaller models. */
- return lps_cmd_ok(sdi->conn, "TRACK%1d", devc->tracking_mode);
- }
- if (devc->model->modelid <= LPS_303) /* Only first setting possible for smaller models. */
- break;
- }
- if (!found) {
+ return sr_sw_limits_config_set(&devc->limits, key, data);
+ case SR_CONF_CHANNEL_CONFIG:
+ if ((idx = std_str_idx(data, ARRAY_AND_SIZE(channel_modes))) < 0)