|
My Project
|
Classes | |
| struct | iio_attr |
| Structure holding meta-data for an attribute. More... | |
Macros | |
| #define | iio_attr_read(attr, ptr) |
| Read the content of the given attribute. | |
| #define | iio_attr_write(attr, val) |
| Set the value of the given attribute. | |
Functions | |
| ssize_t | iio_attr_read_raw (const struct iio_attr *attr, char *dst, size_t len) |
| Read the content of the given attribute. | |
| ssize_t | iio_attr_write_raw (const struct iio_attr *attr, const void *src, size_t len) |
| Set the value of the given attribute. | |
| const char * | iio_attr_get_name (const struct iio_attr *attr) |
| Retrieve the name of an attribute. | |
| const char * | iio_attr_get_filename (const struct iio_attr *attr) |
| Retrieve the filename of an attribute. | |
| const char * | iio_attr_get_static_value (const struct iio_attr *attr) |
| Retrieve the static value of an attribute. | |
| int | iio_attr_get_range (const struct iio_attr *attr, double *min, double *step, double *max) |
| Extract the range from an attribute with suffix '_available'. | |
| int | iio_attr_get_available (const struct iio_attr *attr, char ***list, size_t *count) |
| Extract the list of elements from an attribute with suffix '_available'. | |
| int | iio_attr_get_available_buf (const struct iio_attr *attr, char *buf, size_t buflen, char **list, size_t *count) |
| A variant of iio_attr_get_available() that uses a caller-supplied, preallocated buffer. If the optional 'list' and 'count' parameters are provided, the buffer will be tokenized in place by replacing each delimiter with a null terminator ('\0'). As a result, each element in 'list' will point to the start of a substring in the buffer, representing one of the available values. For instance, 'list[0]' points to the first value, 'list[1]' to the second, and so forth. | |
| void | iio_available_list_free (char **list, size_t count) |
| Free the resources allocated only by iio_attr_get_available(). | |
| #define iio_attr_read | ( | attr, | |
| ptr ) |
Read the content of the given attribute.
| attr | A pointer to an iio_attr structure |
| ptr | A pointer to a variable where the value should be stored |
| #define iio_attr_write | ( | attr, | |
| val ) |
Set the value of the given attribute.
| attr | A pointer to an iio_attr structure |
| val | The value to set the attribute to |
| int iio_attr_get_available | ( | const struct iio_attr * | attr, |
| char *** | list, | ||
| size_t * | count ) |
Extract the list of elements from an attribute with suffix '_available'.
| attr | A pointer to an iio_attr structure |
| list | A pointer to pointer to a dynamically allocated array of strings |
| count | Will be set with the number of words found only if the string was successfully parsed. |
| int iio_attr_get_available_buf | ( | const struct iio_attr * | attr, |
| char * | buf, | ||
| size_t | buflen, | ||
| char ** | list, | ||
| size_t * | count ) |
A variant of iio_attr_get_available() that uses a caller-supplied, preallocated buffer. If the optional 'list' and 'count' parameters are provided, the buffer will be tokenized in place by replacing each delimiter with a null terminator ('\0'). As a result, each element in 'list' will point to the start of a substring in the buffer, representing one of the available values. For instance, 'list[0]' points to the first value, 'list[1]' to the second, and so forth.
| attr | A pointer to an iio_attr structure |
| buf | A buffer where the available data will be stored |
| buflen | The available length of the buffer, in bytes |
| list | Optional output array of char* pointers. Each element points to a token within the provided buffer and must not be freed, as the data is part of the buffer itself. |
| count | On input: should contain the size of the list[] array (number of available slots). On output: will contain the actual number of tokens (strings) found and stored in list[]. parsed. On fail, it will be set to 0 |
| const char * iio_attr_get_filename | ( | const struct iio_attr * | attr | ) |
Retrieve the filename of an attribute.
| attr | A pointer to an iio_attr structure |
| const char * iio_attr_get_name | ( | const struct iio_attr * | attr | ) |
Retrieve the name of an attribute.
| attr | A pointer to an iio_attr structure |
| int iio_attr_get_range | ( | const struct iio_attr * | attr, |
| double * | min, | ||
| double * | step, | ||
| double * | max ) |
Extract the range from an attribute with suffix '_available'.
| attr | A pointer to an iio_attr structure |
| min | Will be set with the range minimum value if string was successfully parsed |
| step | Will be set with the range step value if string was successfully parsed |
| max | Will be set with the range maximum value if string was successfully parsed |
| const char * iio_attr_get_static_value | ( | const struct iio_attr * | attr | ) |
Retrieve the static value of an attribute.
| attr | A pointer to an iio_attr structure |
| ssize_t iio_attr_read_raw | ( | const struct iio_attr * | attr, |
| char * | dst, | ||
| size_t | len ) |
Read the content of the given attribute.
| attr | A pointer to an iio_attr structure |
| dst | A pointer to the memory area where the read data will be stored |
| len | The available length of the memory area, in bytes |
| ssize_t iio_attr_write_raw | ( | const struct iio_attr * | attr, |
| const void * | src, | ||
| size_t | len ) |
Set the value of the given attribute.
| attr | A pointer to an iio_attr structure |
| src | A pointer to the data to be written |
| len | The number of bytes that should be written |
| void iio_available_list_free | ( | char ** | list, |
| size_t | count ) |
Free the resources allocated only by iio_attr_get_available().
| list | A pointer to a dynamically allocated array to be freed |
| count | The number of elements counted by iio_attr_get_available() |