(*model->timebases)[state->timebase][1]);
break;
case SR_CONF_NUM_VDIV:
- if (cg_type == CG_NONE) {
+ if (!cg) {
return SR_ERR_CHANNEL_GROUP;
} else if (cg_type == CG_ANALOG) {
if (std_cg_idx(cg, devc->analog_groups, model->analog_channels) < 0)
}
break;
case SR_CONF_VDIV:
- if (cg_type == CG_NONE) {
+ if (!cg) {
return SR_ERR_CHANNEL_GROUP;
} else if (cg_type == CG_ANALOG) {
if ((idx = std_cg_idx(cg, devc->analog_groups, model->analog_channels)) < 0)
*data = g_variant_new_double(state->horiz_triggerpos);
break;
case SR_CONF_COUPLING:
- if (cg_type == CG_NONE) {
+ if (!cg) {
return SR_ERR_CHANNEL_GROUP;
} else if (cg_type == CG_ANALOG) {
if ((idx = std_cg_idx(cg, devc->analog_groups, model->analog_channels)) < 0)
ret = sr_scpi_send(sdi->conn, command);
break;
case SR_CONF_VDIV:
- if (cg_type == CG_NONE)
+ if (!cg)
return SR_ERR_CHANNEL_GROUP;
if ((idx = std_u64_tuple_idx(data, *model->vdivs, model->num_vdivs)) < 0)
return SR_ERR_ARG;
ret = sr_scpi_send(sdi->conn, command);
break;
case SR_CONF_COUPLING:
- if (cg_type == CG_NONE)
+ if (!cg)
return SR_ERR_CHANNEL_GROUP;
if ((idx = std_str_idx(data, *model->coupling_options, model->num_coupling_options)) < 0)
return SR_ERR_ARG;
*data = std_gvar_array_u32(ARRAY_AND_SIZE(scanopts));
break;
case SR_CONF_DEVICE_OPTIONS:
- if (cg_type == CG_NONE) {
+ if (!cg) {
if (model)
*data = std_gvar_array_u32((const uint32_t *)model->devopts, model->num_devopts);
else
}
break;
case SR_CONF_COUPLING:
- if (cg_type == CG_NONE)
+ if (!cg)
return SR_ERR_CHANNEL_GROUP;
*data = g_variant_new_strv(*model->coupling_options, model->num_coupling_options);
break;
*data = std_gvar_tuple_array(*model->timebases, model->num_timebases);
break;
case SR_CONF_VDIV:
- if (cg_type == CG_NONE)
+ if (!cg)
return SR_ERR_CHANNEL_GROUP;
*data = std_gvar_tuple_array(*model->vdivs, model->num_vdivs);
break;
*data = g_variant_new_uint64(buffersizes[devc->last_step]);
break;
case SR_CONF_VDIV:
- if (ch == -1) {
+ if (!cg) {
return SR_ERR_CHANNEL_GROUP;
} else {
if ((idx = std_u8_idx_s(devc->cctl[ch] & 0x33, ARRAY_AND_SIZE(vdivs_map))) < 0)
}
break;
case SR_CONF_COUPLING:
- if (ch == -1) {
+ if (!cg) {
return SR_ERR_CHANNEL_GROUP;
} else {
if ((idx = std_u8_idx_s(devc->cctl[ch] & 0x0C, ARRAY_AND_SIZE(coupling_map))) < 0)
}
break;
case SR_CONF_PROBE_FACTOR:
- if (ch == -1)
+ if (!cg)
return SR_ERR_CHANNEL_GROUP;
else
*data = g_variant_new_uint64(devc->probe[ch]);
devc->last_step = idx;
break;
case SR_CONF_VDIV:
- if (ch == -1) {
+ if (!cg) {
return SR_ERR_CHANNEL_GROUP;
} else if (!g_variant_is_of_type(data, G_VARIANT_TYPE("(tt)"))) {
return SR_ERR_ARG;
}
break;
case SR_CONF_COUPLING:
- if (ch == -1) {
+ if (!cg) {
return SR_ERR_CHANNEL_GROUP;
} else {
if ((idx = std_str_idx(data, ARRAY_AND_SIZE(coupling))) < 0)
}
break;
case SR_CONF_PROBE_FACTOR:
- if (ch == -1) {
+ if (!cg) {
return SR_ERR_CHANNEL_GROUP;
} else {
u = g_variant_get_uint64(data);
ret = SR_OK;
break;
case SR_CONF_NUM_VDIV:
- if (cg_type == CG_NONE) {
+ if (!cg) {
return SR_ERR_CHANNEL_GROUP;
} else if (cg_type == CG_ANALOG) {
*data = g_variant_new_int32(model->num_ydivs);
break;
case SR_CONF_VDIV:
ret = SR_ERR_NA;
- if (cg_type == CG_NONE) {
+ if (!cg) {
return SR_ERR_CHANNEL_GROUP;
} else if (cg_type != CG_ANALOG)
break;
break;
case SR_CONF_COUPLING:
ret = SR_ERR_NA;
- if (cg_type == CG_NONE) {
+ if (!cg) {
return SR_ERR_CHANNEL_GROUP;
} else if (cg_type != CG_ANALOG)
break;
ret = dlm_trigger_source_set(sdi->conn, (*model->trigger_sources)[idx]);
break;
case SR_CONF_VDIV:
- if (cg_type == CG_NONE)
+ if (!cg)
return SR_ERR_CHANNEL_GROUP;
if ((idx = std_u64_tuple_idx(data, ARRAY_AND_SIZE(dlm_vdivs))) < 0)
return SR_ERR_ARG;
ret = dlm_trigger_slope_set(sdi->conn, state->trigger_slope);
break;
case SR_CONF_COUPLING:
- if (cg_type == CG_NONE)
+ if (!cg)
return SR_ERR_CHANNEL_GROUP;
if ((idx = std_str_idx(data, *model->coupling_options, model->num_coupling_options)) < 0)
return SR_ERR_ARG;
*data = std_gvar_array_u32(NULL, 0);
break;
case SR_CONF_COUPLING:
- if (cg_type == CG_NONE)
+ if (!cg)
return SR_ERR_CHANNEL_GROUP;
*data = g_variant_new_strv(*model->coupling_options, model->num_coupling_options);
break;
case SR_CONF_VDIV:
- if (cg_type == CG_NONE)
+ if (!cg)
return SR_ERR_CHANNEL_GROUP;
*data = std_gvar_tuple_array(ARRAY_AND_SIZE(dlm_vdivs));
break;