|
libiio 1.0
Library for interfacing with IIO devices
|
Data Structures | |
| struct | iio_context |
| Contains the representation of an IIO context. More... | |
Functions | |
| __api __check_ret struct iio_context * | iio_create_context (const struct iio_context_params *params, const char *uri) |
| Create a context from a URI description. | |
| __api void | iio_context_destroy (struct iio_context *ctx) |
| Destroy the given context. | |
| __api __pure unsigned int | iio_context_get_version_major (const struct iio_context *ctx) |
| Get the major number of the library version. | |
| __api __pure unsigned int | iio_context_get_version_minor (const struct iio_context *ctx) |
| Get the minor number of the library version. | |
| __api __pure const char * | iio_context_get_version_tag (const struct iio_context *ctx) |
| Get the git hash string of the library version. | |
| __api __check_ret char * | iio_context_get_xml (const struct iio_context *ctx) |
| Obtain a XML representation of the given context. | |
| __api __check_ret __pure const char * | iio_context_get_name (const struct iio_context *ctx) |
| Get the name of the given context. | |
| __api __check_ret __pure const char * | iio_context_get_description (const struct iio_context *ctx) |
| Get a description of the given context. | |
| __api __check_ret __pure unsigned int | iio_context_get_attrs_count (const struct iio_context *ctx) |
| Get the number of context-specific attributes. | |
| __api __check_ret __pure const struct iio_attr * | iio_context_get_attr (const struct iio_context *ctx, unsigned int index) |
| Retrieve the context-specific attribute at the given index. | |
| __api __check_ret __pure const struct iio_attr * | iio_context_find_attr (const struct iio_context *ctx, const char *name) |
| Try to find a context-specific attribute by its name. | |
| __api __check_ret __pure unsigned int | iio_context_get_devices_count (const struct iio_context *ctx) |
| Enumerate the devices found in the given context. | |
| __api __check_ret __pure struct iio_device * | iio_context_get_device (const struct iio_context *ctx, unsigned int index) |
| Get the device present at the given index. | |
| __api __check_ret __pure struct iio_device * | iio_context_find_device (const struct iio_context *ctx, const char *name) |
| Try to find a device structure by its ID, label or name. | |
| __api __check_ret int | iio_context_set_timeout (struct iio_context *ctx, unsigned int timeout_ms) |
| Set a timeout for I/O operations. | |
| __api __cnst const struct iio_context_params * | iio_context_get_params (const struct iio_context *ctx) |
| Get a pointer to the params structure. | |
| __api void | iio_context_set_data (struct iio_context *ctx, void *data) |
| Associate a pointer to an iio_context structure. | |
| __api void * | iio_context_get_data (const struct iio_context *ctx) |
| Retrieve a previously associated pointer of an iio_context structure. | |
| __api void iio_context_destroy | ( | struct iio_context * | ctx | ) |
Destroy the given context.
| ctx | A pointer to an iio_context structure |
NOTE: After that function, the iio_context pointer shall be invalid.


| __api __check_ret __pure const struct iio_attr * iio_context_find_attr | ( | const struct iio_context * | ctx, |
| const char * | name | ||
| ) |
Try to find a context-specific attribute by its name.
| ctx | A pointer to an iio_context structure |
| name | A NULL-terminated string corresponding to the name of the attribute |
| __api __check_ret __pure struct iio_device * iio_context_find_device | ( | const struct iio_context * | ctx, |
| const char * | name | ||
| ) |
Try to find a device structure by its ID, label or name.
| ctx | A pointer to an iio_context structure |
| name | A NULL-terminated string corresponding to the ID, label or name of the device to search for |


| __api __check_ret __pure const struct iio_attr * iio_context_get_attr | ( | const struct iio_context * | ctx, |
| unsigned int | index | ||
| ) |
Retrieve the context-specific attribute at the given index.
| ctx | A pointer to an iio_context structure |
| index | The index corresponding to the attribute |
| __api __check_ret __pure unsigned int iio_context_get_attrs_count | ( | const struct iio_context * | ctx | ) |
Get the number of context-specific attributes.
| ctx | A pointer to an iio_context structure |
Introduced in version 0.9.


| __api void * iio_context_get_data | ( | const struct iio_context * | ctx | ) |
Retrieve a previously associated pointer of an iio_context structure.
| ctx | A pointer to an iio_context structure |

| __api __check_ret __pure const char * iio_context_get_description | ( | const struct iio_context * | ctx | ) |
Get a description of the given context.
| ctx | A pointer to an iio_context structure |
NOTE:The returned string will contain human-readable information about the current context.


| __api __check_ret __pure struct iio_device * iio_context_get_device | ( | const struct iio_context * | ctx, |
| unsigned int | index | ||
| ) |
Get the device present at the given index.
| ctx | A pointer to an iio_context structure |
| index | The index corresponding to the device |


| __api __check_ret __pure unsigned int iio_context_get_devices_count | ( | const struct iio_context * | ctx | ) |
Enumerate the devices found in the given context.
| ctx | A pointer to an iio_context structure |


| __api __check_ret __pure const char * iio_context_get_name | ( | const struct iio_context * | ctx | ) |
Get the name of the given context.
| ctx | A pointer to an iio_context structure |
NOTE:The returned string will be local, xml or network when the context has been created with the local, xml and network backends respectively.


| __api __cnst const struct iio_context_params * iio_context_get_params | ( | const struct iio_context * | ctx | ) |
Get a pointer to the params structure.
| ctx | A pointer to an iio_context structure |
| __api __pure unsigned int iio_context_get_version_major | ( | const struct iio_context * | ctx | ) |
Get the major number of the library version.
| ctx | Optional pointer to an iio_context structure |
NOTE: If ctx is non-null, it will return the major version of the remote library, if running remotely.
| __api __pure unsigned int iio_context_get_version_minor | ( | const struct iio_context * | ctx | ) |
Get the minor number of the library version.
| ctx | Optional pointer to an iio_context structure |
NOTE: If ctx is non-null, it will return the minor version of the remote library, if running remotely.
| __api __pure const char * iio_context_get_version_tag | ( | const struct iio_context * | ctx | ) |
Get the git hash string of the library version.
| ctx | Optional pointer to an iio_context structure |
NOTE: If ctx is non-null, it will return the git tag or hash of the remote library, if running remotely.
| __api __check_ret char * iio_context_get_xml | ( | const struct iio_context * | ctx | ) |
Obtain a XML representation of the given context.
| ctx | A pointer to an iio_context structure |

| __api void iio_context_set_data | ( | struct iio_context * | ctx, |
| void * | data | ||
| ) |
Associate a pointer to an iio_context structure.
| ctx | A pointer to an iio_context structure |
| data | The pointer to be associated |
| __api __check_ret int iio_context_set_timeout | ( | struct iio_context * | ctx, |
| unsigned int | timeout_ms | ||
| ) |
Set a timeout for I/O operations.
| ctx | A pointer to an iio_context structure |
| timeout_ms | A positive integer representing the time in milliseconds after which a timeout occurs. A value of 0 is used to specify that no timeout should occur. |


| __api __check_ret struct iio_context * iio_create_context | ( | const struct iio_context_params * | params, |
| const char * | uri | ||
| ) |
Create a context from a URI description.
| params | A pointer to a iio_context_params structure that contains context creation information; can be NULL |
| uri | a URI describing the context location. If NULL, the backend will be created using the URI string present in the IIOD_REMOTE environment variable, or if not set, a local backend is created. |
NOTE: The following URIs are supported based on compile time backend support:
Serial backend, "serial:"
Requires:
For example "serial:/dev/ttyUSB0,115200" or "serial:/dev/ttyUSB0,115200,8n1"
