Function libiio_sys::iio_channel_attr_write
source · [−]pub unsafe extern "C" fn iio_channel_attr_write(
chn: *const iio_channel,
attr: *const c_char,
src: *const c_char
) -> isize
Expand description
@brief Set the value of the given channel-specific attribute @param chn A pointer to an iio_channel structure @param attr A NULL-terminated string corresponding to the name of the attribute @param src A NULL-terminated string to set the attribute to @return On success, the number of bytes written @return On error, a negative errno code is returned
NOTE:By passing NULL as the “attr” argument to iio_channel_attr_write, it is now possible to write all of the attributes of a channel.
The buffer must contain one block of data per attribute of the channel, by the order they appear in the iio_channel structure.
The first four bytes of one block correspond to a 32-bit signed value in network order. If negative, the attribute is not written; if positive, it corresponds to the length of the data to write. In that case, the rest of the block must contain the data.