Math feature does not correct support channel names such as voltage0_i and voltage0_q
BrentK-ADI opened this issue · comments
For certain IIO devices (such as the ADRV9002 in MIMO mode), the channel names of the devices are suffixed with _i and _q, while retaining the same channel number.
The eval function in math_expression_generator.h assumes the channel number is unique, and incorrectly selects the index into the channels_data array. For example, the math expression atanf(voltage0_q / voltage0_i) will evaluate to atanf(channels_data[0] / channels_data[0]). Channel selection should likely be based on name rather than assuming unique channel numbers.
for (pos = match; *pos; pos++) {
if (g_ascii_isdigit(*pos))
break;
}
if ((size_t)(pos - match) < strlen(match))
index = atoi(pos);
else
index = 0;
Hi,
We are looking into this