I was wondering if Libiio's iio_buffer_push() function blocks when in non-cyclic mode? If it's non-blocking, is there a way to check if the buffer push is complete?
It blocks when no space is available in the DMA buffer, i.e. when your application is generating data faster than the device consumes it. And well, the buffer push is complete when the function returns. If you were running this in a separate thread and want to check from another thread whether it has completed set a variable to 0 before calling iio_buffer_push() and set it to 1 once it has completed.
There are some new additions to the API which allow you to enable/disable blocking dynamically. This way you can also use poll() to check whether there is enough room for new data or not, so that iio_buffer_push() if called does not block.
Retrieving data ...