Skip to content

Commit

Permalink
iio_info: warn when iio_channel_get_type = IIO_CHAN_TYPE_UNKNOWN
Browse files Browse the repository at this point in the history
A few issues (analogdevicesinc#366, analogdevicesinc#373)  have popped up recently when
     iio_channel_get_type(ch) == IIO_CHAN_TYPE_UNKNOWN

This helps bring that to the top by easily notifing kernel developers
when they are doing things that aren't understood by the library.

Signed-off-by: Robin Getz <[email protected]>
  • Loading branch information
rgetz authored and cristi-iacob committed Feb 17, 2020
1 parent 664665d commit ad58958
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/iio_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ int main(int argc, char **argv)
iio_channel_get_id(ch),
name ? name : "", type_name);

if (iio_channel_get_type(ch) == IIO_CHAN_TYPE_UNKNOWN)
printf(", WARN:iio_channel_get_type()=UNKNOWN");

if (iio_channel_is_scan_element(ch)) {
const struct iio_data_format *format =
iio_channel_get_data_format(ch);
Expand Down

0 comments on commit ad58958

Please sign in to comment.