libiio
Classes | Functions
Stream

Classes

struct  iio_stream
 A helper object to simplify reading/writing to a iio_buffer. More...
 

Functions

__api __check_ret struct iio_streamiio_buffer_create_stream (struct iio_buffer *buffer, size_t nb_blocks, size_t samples_count)
 Create a iio_stream object for the given iio_buffer. More...
 
__api void iio_stream_destroy (struct iio_stream *stream)
 Destroy the given stream object. More...
 
__api __check_ret const struct iio_blockiio_stream_get_next_block (struct iio_stream *stream)
 Get a pointer to the next data block. More...
 

Detailed Description

Function Documentation

◆ iio_buffer_create_stream()

__api __check_ret struct iio_stream* iio_buffer_create_stream ( struct iio_buffer buffer,
size_t  nb_blocks,
size_t  samples_count 
)

Create a iio_stream object for the given iio_buffer.

Parameters
bufferA pointer to an iio_buffer structure
nb_blocksThe number of iio_block objects to create, internally. In doubt, a good value is 4.
samples_countThe size of the iio_block objects, in samples
Returns
On success, a pointer to an iio_stream structure
On failure, a pointer-encoded error is returned

◆ iio_stream_destroy()

__api void iio_stream_destroy ( struct iio_stream stream)

Destroy the given stream object.

Parameters
streamA pointer to an iio_stream structure

◆ iio_stream_get_next_block()

__api __check_ret const struct iio_block* iio_stream_get_next_block ( struct iio_stream stream)

Get a pointer to the next data block.

Parameters
streamA pointer to an iio_stream structure
Returns
On success, a pointer to an iio_block structure
On failure, a pointer-encoded error is returned