C# bindings for libiio: iio.Context Class Reference

C# bindings for libiio 1.0 C# bindings for libIIO

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Properties | List of all members
iio.Context Class Reference

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

Inherits iio.IIOObject.

## Public Member Functions
| Context (IioContextParams contextParams, string uri=null)
| Initializes a new instance of the iio.Context class using the specified context parameters.
| 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.
Device | get_device (string name)
| Get the iio.Device object of the specified name.
void | set_timeout (uint timeout)
| Set a timeout for I/O operations.
IioContextParams | GetContextParams ()
| Retrieves the parameters of the current IIO context.

## Public Attributes
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 | library_version
| Retrieve a information about the version context.
readonly Version | backend_version
readonly List< Device > | devices
| A `List` of all the IIO devices present on the current context.

## Protected Member Functions
override void | Destroy ()

## Properties
Dictionary< string, string > | attrs`[get]`
| A `Dictionary` of all the attributes of the current channel. (key, value) = (name, value)

## Detailed Description

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

Examples
  ExampleProgram.cs.

## Constructor & Destructor Documentation

## ◆ Context() [1/2]

iio.Context.Context | ( | IioContextParams | contextParams,
|  | string | uri = `null`
| ) |  |
| inline

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

Parameters

  contextParams | The parameters used to configure the IIO context.
  uri | URI to use for the IIO context creation

Returns
  an instance of the iio.Context class

Exceptions

  IioLib.IIOException | The IIO context could not be created.

## ◆ Context() [2/2]

iio.Context.Context | ( | string | uri = `null` | ) |
| inline

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.

Parameters

  uri | URI to use for the IIO context creation

Returns
  an instance of the iio.Context class

Exceptions

  IioLib.IIOException | The IIO context could not be created.

## Member Function Documentation

## ◆ get_device()

Device iio.Context.get_device | ( | string | name | ) |
| inline

Get the iio.Device object of the specified name.

Parameters

  name | Name or ID of the device to look for

Exceptions

  IioLib.IIOException | The IIO device with the specified name or ID could not be found in the current context.

## ◆ GetContextParams()

IioContextParams iio.Context.GetContextParams | ( |  | ) |
| inline

Retrieves the parameters of the current IIO context.

Returns
  An instance of IioContextParams representing the context parameters.

Exceptions

  IioLib.IIOException | Thrown if the parameters could not be retrieved.

## ◆ set_timeout()

void iio.Context.set_timeout | ( | uint | timeout | ) |
| inline

Set a timeout for I/O operations.

Parameters

  timeout | The timeout value, in milliseconds

Exceptions

  IioLib.IIOException | The timeout could not be applied.

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

- Context.cs