Should iio_channel_convert take a destination data length? #1093
jamesoncollins
started this conversation in
General
Replies: 1 comment
-
Alternatively, can it be guaranteed somewhere that length will always be 8,16,32,64 while bits can be any value? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
https://github.com/analogdevicesinc/libiio/blob/main/include/iio/iio.h#L1400
iio_channel_convert assumes its copying
iio_channel_get_data_format(chn)->length / 8
bytes from the source buffer to the destination buffer. Is there anythig that says that the format length of a channel has to be 8, 16, 32, or 64 bits? Could it be 24-byts?If that's the case, and given that this function is called sample-by-sample, then wouldn't it make sense to let this function convert from a native 3-byte format to 4-bytes?
Beta Was this translation helpful? Give feedback.
All reactions