pub unsafe extern "C" fn iio_buffer_foreach_sample(
    buf: *mut iio_buffer,
    callback: Option<unsafe extern "C" fn(chn: *const iio_channel, src: *mut c_void, bytes: usize, d: *mut c_void) -> isize>,
    data: *mut c_void
) -> isize
Expand description

@brief Call the supplied callback for each sample found in a buffer @param buf A pointer to an iio_buffer structure @param callback A pointer to a function to call for each sample found @param data A user-specified pointer that will be passed to the callback @return number of bytes processed.

NOTE: The callback receives four arguments:

  • A pointer to the iio_channel structure corresponding to the sample,
  • A pointer to the sample itself,
  • The length of the sample in bytes,
  • The user-specified pointer passed to iio_buffer_foreach_sample.