|
| __api __check_ret ssize_t | iio_attr_read_raw (const struct iio_attr *attr, char *dst, size_t len) |
| | Read the content of the given attribute.
|
| |
| __api __check_ret ssize_t | iio_attr_write_raw (const struct iio_attr *attr, const void *src, size_t len) |
| | Set the value of the given attribute.
|
| |
| __api __pure const char * | iio_attr_get_name (const struct iio_attr *attr) |
| | Retrieve the name of an attribute.
|
| |
| __api __check_ret __pure const char * | iio_attr_get_filename (const struct iio_attr *attr) |
| | Retrieve the filename of an attribute.
|
| |
| __api __pure const char * | iio_attr_get_static_value (const struct iio_attr *attr) |
| | Retrieve the static value of an attribute.
|
| |
| __api 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'.
|
| |
| __api 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'.
|
| |
| __api 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.
|
| |
| __api void | iio_available_list_free (char **list, size_t count) |
| | Free the resources allocated only by iio_attr_get_available()
|
| |
| __api 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.
- Parameters
-
| 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 |
- Returns
- On success, 0 is returned
-
On error, a negative errno code is returned. For attributes without the '_available' suffix, -ENXIO is returned. For attributes whose values are in a range format, -EOPNOTSUPP is returned. If not enough space is available in list[], the function returns -ENOSPC