Skip to content

Commit

Permalink
iio-backend: Add functions iio_{context,device,channel}_add_attr()
Browse files Browse the repository at this point in the history
These functions can be used to add an attribute to an iio_context,
iio_device and iio_channel respectively.

Signed-off-by: Paul Cercueil <[email protected]>
  • Loading branch information
pcercuei authored and mhennerich committed Mar 11, 2024
1 parent f68d00f commit 97f7a25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 0 additions & 7 deletions attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,4 @@ int iio_add_attr(union iio_pointer p, struct iio_attr_list *attrs,
const char *name, const char *filename,
enum iio_attr_type type);

int iio_context_add_attr(struct iio_context *ctx,
const char *key, const char *value);
int iio_device_add_attr(struct iio_device *dev,
const char *name, enum iio_attr_type type);
int iio_channel_add_attr(struct iio_channel *chn,
const char *name, const char *filename);

#endif /* __IIO_ATTR_H__ */
10 changes: 10 additions & 0 deletions include/iio/iio-backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ iio_device_add_channel(struct iio_device *dev, long index,
const char *id, const char *name, bool output,
bool scan_element, const struct iio_data_format *fmt);

__api int
iio_context_add_attr(struct iio_context *ctx,
const char *key, const char *value);
__api int
iio_device_add_attr(struct iio_device *dev,
const char *name, enum iio_attr_type type);
__api int
iio_channel_add_attr(struct iio_channel *chn,
const char *name, const char *filename);

__api struct iio_context_pdata *
iio_context_get_pdata(const struct iio_context *ctx);

Expand Down

0 comments on commit 97f7a25

Please sign in to comment.