Function libiio_sys::iio_buffer_first
source · pub unsafe extern "C" fn iio_buffer_first(
buf: *const iio_buffer,
chn: *const iio_channel
) -> *mut c_void
Expand description
@brief Find the first sample of a channel in a buffer @param buf A pointer to an iio_buffer structure @param chn A pointer to an iio_channel structure @return A pointer to the first sample found, or to the end of the buffer if no sample for the given channel is present in the buffer
NOTE: This fonction, coupled with iio_buffer_step and iio_buffer_end, can be used to iterate on all the samples of a given channel present in the buffer, doing the following:
@verbatim for (void *ptr = iio_buffer_first(buffer, chn); ptr < iio_buffer_end(buffer); ptr += iio_buffer_step(buffer)) { …. } @endverbatim