C# bindings for libiio  0.24
C# bindings for libIIO
iio.IOBuffer Class Reference

iio.IOBuffer class: The class used for all I/O operations. More...

Inherits IDisposable.

Public Member Functions

 IOBuffer (Device dev, uint samples_count, bool circular=false)
 Initializes a new instance of the iio.IOBuffer class. More...
 
void refill ()
 Fetch a new set of samples from the hardware. More...
 
void push (uint samples_count)
 Submit the samples contained in this buffer to the hardware. More...
 
void push ()
 Submit all the samples contained in this buffer to the hardware. More...
 
void Dispose ()
 Releases all resource used by the iio.IOBuffer object. More...
 
void fill (byte[] array)
 Copy the given array of samples inside the iio.IOBuffer object. More...
 
void read (byte[] array)
 Extract the samples from the iio.IOBuffer object. More...
 
int get_poll_fd ()
 Returns poll file descriptor for the current buffer. More...
 
int set_blocking_mode (bool blocking)
 Sets the blocking behavior of the current buffer. More...
 
void cancel ()
 Cancels the current buffer. More...
 
Device get_device ()
 Gets the device of the current buffer. More...
 
IntPtr first (Channel ch)
 Gets a pointer to the first sample from the current buffer for a specific channel. More...
 
long step ()
 Gets the step size of the current buffer. More...
 

Public Attributes

readonly uint samples_count
 The size of this buffer, in samples. More...
 
readonly bool circular
 If true, the buffer is circular. More...
 

Detailed Description

iio.IOBuffer class: The class used for all I/O operations.

Constructor & Destructor Documentation

◆ IOBuffer()

iio.IOBuffer.IOBuffer ( Device  dev,
uint  samples_count,
bool  circular = false 
)
inline

Initializes a new instance of the iio.IOBuffer class.

Parameters
devThe iio.Device object that represents the device where the I/O operations will be performed.
samples_countThe size of the buffer, in samples.
circularIf set to true, the buffer is circular.
Exceptions
System.ExceptionThe buffer could not be created.

Member Function Documentation

◆ cancel()

void iio.IOBuffer.cancel ( )
inline

Cancels the current buffer.

◆ Dispose()

void iio.IOBuffer.Dispose ( )
inline

Releases all resource used by the iio.IOBuffer object.

Call Dispose when you are finished using the iio.IOBuffer. The Dispose method leaves the iio.IOBuffer in an unusable state. After calling Dispose, you must release all references to the iio.IOBuffer so the garbage collector can reclaim the memory that the iio.IOBuffer was occupying.

◆ fill()

void iio.IOBuffer.fill ( byte[]  array)
inline

Copy the given array of samples inside the iio.IOBuffer object.

Parameters
arrayA byte array containing the samples that should be written.

The number of samples written will not exceed the size of the buffer.

◆ first()

IntPtr iio.IOBuffer.first ( Channel  ch)
inline

Gets a pointer to the first sample from the current buffer for a specific channel.

Parameters
chThe channel for which to find the first sample.

◆ get_device()

Device iio.IOBuffer.get_device ( )
inline

Gets the device of the current buffer.

Returns
The device of the current buffer.

◆ get_poll_fd()

int iio.IOBuffer.get_poll_fd ( )
inline

Returns poll file descriptor for the current buffer.

◆ push() [1/2]

void iio.IOBuffer.push ( )
inline

Submit all the samples contained in this buffer to the hardware.

◆ push() [2/2]

void iio.IOBuffer.push ( uint  samples_count)
inline

Submit the samples contained in this buffer to the hardware.

Exceptions
System.ExceptionThe buffer could not be pushed.

◆ read()

void iio.IOBuffer.read ( byte[]  array)
inline

Extract the samples from the iio.IOBuffer object.

Parameters
arrayA byte array containing the extracted samples.

◆ refill()

void iio.IOBuffer.refill ( )
inline

Fetch a new set of samples from the hardware.

Exceptions
System.ExceptionThe buffer could not be refilled.

◆ set_blocking_mode()

int iio.IOBuffer.set_blocking_mode ( bool  blocking)
inline

Sets the blocking behavior of the current buffer.

Parameters
blockingtrue if blocking buffer, otherwise false

◆ step()

long iio.IOBuffer.step ( )
inline

Gets the step size of the current buffer.

Member Data Documentation

◆ circular

readonly bool iio.IOBuffer.circular

If true, the buffer is circular.

◆ samples_count

readonly uint iio.IOBuffer.samples_count

The size of this buffer, in samples.


The documentation for this class was generated from the following file: