C# bindings for libiio  0.20
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

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.

Here is the call graph for this function:

Member Function Documentation

void iio.IOBuffer.cancel ( )
inline

Cancels the current buffer.

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.

Here is the caller graph for this function:

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.

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.
Device iio.IOBuffer.get_device ( )
inline

Gets the device of the current buffer.

Returns
The device of the current buffer.
int iio.IOBuffer.get_poll_fd ( )
inline

Returns poll file descriptor for the current buffer.

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.
void iio.IOBuffer.push ( )
inline

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

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

Extract the samples from the iio.IOBuffer object.

Parameters
arrayA byte array containing the extracted samples.
void iio.IOBuffer.refill ( )
inline

Fetch a new set of samples from the hardware.

Exceptions
System.ExceptionThe buffer could not be refilled.
int iio.IOBuffer.set_blocking_mode ( bool  blocking)
inline

Sets the blocking behavior of the current buffer.

Parameters
blockingtrue if blocking buffer, otherwise false
long iio.IOBuffer.step ( )
inline

Gets the step size of the current buffer.

Member Data Documentation

readonly bool iio.IOBuffer.circular

If true, the buffer is circular.

readonly uint iio.IOBuffer.samples_count

The size of this buffer, in samples.


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