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 committed Feb 11, 2020
1 parent 04bcd54 commit 6c40e8c
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 6c40e8c

Please sign in to comment.