Context

class iio.Context : iio.IIOObject

iio.Context class: Contains the representation of an IIO context.

Public Functions

Context (IioContextParams contextParams, string uri = null)

Initializes a new instance of the iio.Context class using the specified context parameters.

Param contextParams:

The parameters used to configure the IIO context.

Param uri:

URI to use for the IIO context creation

Throws IioLib.IIOException:

The IIO context could not be created.

Return:

an instance of the iio.Context class

Context (string uri = null)

Initializes a new instance of the iio.Context class, using the provided URI. For compatibility with existing code, providing an IP address or a hostname here will automatically create a network context.

Param uri:

URI to use for the IIO context creation

Throws IioLib.IIOException:

The IIO context could not be created.

Return:

an instance of the iio.Context class

Device get_device (string name)

Get the iio.Device object of the specified name.

Param name:

Name, ID, or label of the device to look for

Throws IioLib.IIOException:

The IIO device with the specified name, ID, or label could not be found in the current context.

void set_timeout (int timeout)

Set a timeout for I/O operations.

Param timeout:

The timeout value, in milliseconds. 0 = use backend default, -1 = infinite, int.MinValue = nonblock

Throws IioLib.IIOException:

The timeout could not be applied.

void ping ()

Ping the IIO context to check if it is still responsive.

Throws IioLib.IIOException:

The context did not respond.

IioContextParams GetContextParams ()

Retrieves the parameters of the current IIO context.

Throws IioLib.IIOException:

Thrown if the parameters could not be retrieved.

Return:

An instance of IioContextParams representing the context parameters.

Public Members

readonly string xml

A XML representation of the current context.

readonly string name

The name of the current context.

readonly string description

Retrieve a human-readable information string about the current context.

readonly Version backend_version

Retrieve the version of the remote backend library. For local contexts this equals IioLib.library_version. Use IioLib.library_version to get the local library version.

readonly IReadOnlyList<Device> devices

A List of all the IIO devices present on the current context.

Properties

string > attrs { get; set; }

A Dictionary of all the attributes of the current context. (key, value) = (name, value)