# memberdef

refid: a468e63487927f99e339883e6b1a78fd8
name: write
type: ssize_t(*
argsstring: )(struct iio_context_pdata *pdata, void *desc, const char *src, size_t len)
scope: iiod_client_ops
definition:
ssize_t(* iiod_client_ops::write)(struct iio_context_pdata *pdata, void *desc, const char *src, size_t len)


refid: a9f795e70e3d732fd3c64010f40010d0a
name: read
type: ssize_t(*
argsstring: )(struct iio_context_pdata *pdata, void *desc, char *dst, size_t len)
scope: iiod_client_ops
definition:
ssize_t(* iiod_client_ops::read)(struct iio_context_pdata *pdata, void *desc, char *dst, size_t len)


refid: acd8bda13961b64ad8b884fe2c6a87268
name: read_line
type: ssize_t(*
argsstring: )(struct iio_context_pdata *pdata, void *desc, char *dst, size_t len)
scope: iiod_client_ops
definition:
ssize_t(* iiod_client_ops::read_line)(struct iio_context_pdata *pdata, void *desc, char *dst, size_t len)


refid: ga55574e54de682499c5c08566c652114a
name: iio_get_backend
definition: const char* iio_get_backend
type: const char *
argsstring: (unsigned int index)
briefdescription: Retrieve the name of a given backend.
detaileddescription:
@param index The index corresponding to the attribute
@return On success, a pointer to a static NULL-terminated string
@return If the index is invalid, NULL is returned

Introduced in version 0.9.  


refid: gac261dc30aa66453d1eabed1e88aa8728
name: iio_has_backend
definition: bool iio_has_backend
type: bool
argsstring: (const char *backend)
briefdescription: Check if the specified backend is available.
detaileddescription:
@param backend The name of the backend to query
@return True if the backend is available, false otherwise

Introduced in version 0.9.  


refid: ga6caadf077c112ae55a64276aa24ef832
name: iio_device_create_buffer
definition: struct iio_buffer* iio_device_create_buffer
type: struct iio_buffer *
argsstring: (const struct iio_device *dev, size_t samples_count, bool cyclic)
briefdescription: Create an input or output buffer associated to the given device.
detaileddescription:
@param dev A pointer to an iio_device structure
@param samples_count The number of samples that the buffer should contain
@param cyclic If True, enable cyclic mode
@return On success, a pointer to an iio_buffer structure
@return On error, NULL is returned, and errno is set to the error code

<b>NOTE:</b> Channels that have to be written to / read from must be enabled
before creating the buffer.  


refid: gaba58dc2780be63fead6f09397ce90d10
name: iio_buffer_destroy
definition: void iio_buffer_destroy
type: void
argsstring: (struct iio_buffer *buffer)
briefdescription: Destroy the given buffer.
detaileddescription:
@param buf A pointer to an iio_buffer structure

<b>NOTE:</b> After that function, the iio_buffer pointer shall be invalid.  


refid: ga2a6445a0776a43ffee1fd07ae45b7a58
name: iio_buffer_get_poll_fd
definition: int iio_buffer_get_poll_fd
type: int
argsstring: (struct iio_buffer *buffer)
briefdescription: Get a pollable file descriptor.
detaileddescription:
Can be used to know when iio_buffer_refill() or iio_buffer_push() can be
called
@param buf A pointer to an iio_buffer structure
@return On success, valid file descriptor
@return On error, a negative errno code is returned


refid: ga8306f2992b49b99b6456907b65ece5aa
name: iio_buffer_set_blocking_mode
definition: int iio_buffer_set_blocking_mode
type: int
argsstring: (struct iio_buffer *buffer, bool blocking)
briefdescription: Make iio_buffer_refill() and iio_buffer_push() blocking or not.
detaileddescription:
After this function has been called with blocking == false,
iio_buffer_refill() and iio_buffer_push() will return -EAGAIN if no data is
ready.
A device is blocking by default.
@param buf A pointer to an iio_buffer structure
@param blocking true if the buffer API should be blocking, else false
@return On success, 0
@return On error, a negative errno code is returned


refid: ga1aaecd70bdb441c8faaf061672060516
name: iio_buffer_refill
definition: ssize_t iio_buffer_refill
type: ssize_t
argsstring: (struct iio_buffer *buffer)
briefdescription: Fetch more samples from the hardware.
detaileddescription:
@param buf A pointer to an iio_buffer structure
@return On success, the number of bytes read is returned
@return On error, a negative errno code is returned

<b>NOTE:</b> Only valid for input buffers  


refid: ga28c43d91ddaf8856f2d1a79562072280
name: iio_buffer_push
definition: ssize_t iio_buffer_push
type: ssize_t
argsstring: (struct iio_buffer *buffer)
briefdescription: Send the samples to the hardware.
detaileddescription:
@param buf A pointer to an iio_buffer structure
@return On success, the number of bytes written is returned
@return On error, a negative errno code is returned

<b>NOTE:</b> Only valid for output buffers  


refid: ga705f8f74e26d872dbec6cf718671c830
name: iio_buffer_push_partial
definition: ssize_t iio_buffer_push_partial
type: ssize_t
argsstring: (struct iio_buffer *buffer, size_t samples_count)
briefdescription: Send a given number of samples to the hardware.
detaileddescription:
@param buf A pointer to an iio_buffer structure
@param samples_count The number of samples to submit
@return On success, the number of bytes written is returned
@return On error, a negative errno code is returned

<b>NOTE:</b> Only valid for output buffers  


refid: af5858a01a68d1d16a4286838c032c8ce
name: iio_buffer_foreach_sample
definition: ssize_t iio_buffer_foreach_sample
type: ssize_t
argsstring:
(struct iio_buffer *buffer, ssize_t(*callback)(const struct iio_channel *, void *, size_t, void *), void *d)


refid: ga7fdacbfda79aa5120f34ea73ae2ea5ab
name: iio_buffer_start
definition: void* iio_buffer_start
type: void *
argsstring: (const struct iio_buffer *buffer)
briefdescription: Get the start address of the buffer.
detaileddescription:
@param buf A pointer to an iio_buffer structure
@return A pointer corresponding to the start address of the buffer  


refid: ga000d2f4c8b72060db1c38ec905bf4156
name: iio_buffer_first
definition: void* iio_buffer_first
type: void *
argsstring: (const struct iio_buffer *buffer, const struct iio_channel *chn)
briefdescription: Find the first sample of a channel in a buffer.
detaileddescription:
  @param buf A pointer to an iio_buffer structure
  @param chn A pointer to an iio_channel structure
  @return A pointer to the first sample found, or to the end of the buffer if
  no sample for the given channel is present in the buffer

  <b>NOTE:</b> This fonction, coupled with iio_buffer_step and iio_buffer_end,
  can be used to iterate on all the samples of a given channel present in the
  buffer, doing the following:

@verbatim 
for (void *ptr = iio_buffer_first(buffer, chn); ptr < iio_buffer_end(buffer); ptr += iio_buffer_step(buffer)) {
   ....
}
@endverbatim  


refid: ga18d5cb8d912b5b888b9b54c6d0c7f92c
name: iio_buffer_step
definition: ptrdiff_t iio_buffer_step
type: ptrdiff_t
argsstring: (const struct iio_buffer *buffer)
briefdescription: Get the step size between two samples of one channel.
detaileddescription:
@param buf A pointer to an iio_buffer structure
@return the difference between the addresses of two consecutive samples of
one same channel  


refid: gab5300f917bbdfc5dafc093a60138f131
name: iio_buffer_end
definition: void* iio_buffer_end
type: void *
argsstring: (const struct iio_buffer *buffer)
briefdescription: Get the address that follows the last sample in a buffer.
detaileddescription:
@param buf A pointer to an iio_buffer structure
@return A pointer corresponding to the address that follows the last sample
present in the buffer  


refid: gac110da795a50dc45fe998cace656329b
name: iio_buffer_get_data
definition: void* iio_buffer_get_data
type: void *
argsstring: (const struct iio_buffer *buf)
briefdescription: Retrieve a previously associated pointer of an iio_buffer structure.
detaileddescription:
@param buf A pointer to an iio_buffer structure
@return The pointer previously associated if present, or NULL  


refid: ga0e42431688750313cfa077ab4f6e0282
name: iio_buffer_cancel
definition: void iio_buffer_cancel
type: void
argsstring: (struct iio_buffer *buf)
briefdescription: Cancel all buffer operations.
detaileddescription:
@param buf The buffer for which operations should be canceled

This function cancels all outstanding buffer operations previously scheduled.
This means any pending iio_buffer_push() or iio_buffer_refill() operation
will abort and return immediately, any further invocations of these functions
on the same buffer will return immediately with an error.

Usually iio_buffer_push() and iio_buffer_refill() will block until either all
data has been transferred or a timeout occurs. This can depending on the
configuration take a significant amount of time. iio_buffer_cancel() is
useful to bypass these conditions if the buffer operation is supposed to be
stopped in response to an external event (e.g. user input).

To be able to capture additional data after calling this function the buffer
should be destroyed and then re-created.

This function can be called multiple times for the same buffer, but all but
the first invocation will be without additional effect.

This function is thread-safe, but not signal-safe, i.e. it must not be called
from a signal handler.


refid: a1069f257dfacdc3a6b9eb7def13811da
name: iio_chan_type_name_spec
definition: const char* const iio_chan_type_name_spec[]
type: const char *const
argsstring: []
initializer:
= {
	[IIO_VOLTAGE] = "voltage",
	[IIO_CURRENT] = "current",
	[IIO_POWER] = "power",
	[IIO_ACCEL] = "accel",
	[IIO_ANGL_VEL] = "anglvel",
	[IIO_MAGN] = "magn",
	[IIO_LIGHT] = "illuminance",
	[IIO_INTENSITY] = "intensity",
	[IIO_PROXIMITY] = "proximity",
	[IIO_TEMP] = "temp",
	[IIO_INCLI] = "incli",
	[IIO_ROT] = "rot",
	[IIO_ANGL] = "angl",
	[IIO_TIMESTAMP] = "timestamp",
	[IIO_CAPACITANCE] = "capacitance",
	[IIO_ALTVOLTAGE] = "altvoltage",
	[IIO_CCT] = "cct",
	[IIO_PRESSURE] = "pressure",
	[IIO_HUMIDITYRELATIVE] = "humidityrelative",
	[IIO_ACTIVITY] = "activity",
	[IIO_STEPS] = "steps",
	[IIO_ENERGY] = "energy",
	[IIO_DISTANCE] = "distance",
	[IIO_VELOCITY] = "velocity",
	[IIO_CONCENTRATION] = "concentration",
	[IIO_RESISTANCE] = "resistance",
	[IIO_PH] = "ph",
}


refid: gaf4e082d88d0dfe4f078abfa633dc18a6
name: iio_channel_get_id
definition: const char* iio_channel_get_id
type: const char *
argsstring: (const struct iio_channel *chn)
briefdescription: Retrieve the channel ID (e.g. <b><i>voltage0</i></b>)
detaileddescription:
@param chn A pointer to an iio_channel structure
@return A pointer to a static NULL-terminated string  


refid: ga49d2593f3bb7c3b0a618e65d34888d76
name: iio_channel_get_name
definition: const char* iio_channel_get_name
type: const char *
argsstring: (const struct iio_channel *chn)
briefdescription: Retrieve the channel name (e.g. <b><i>vccint</i></b>)
detaileddescription:
@param chn A pointer to an iio_channel structure
@return A pointer to a static NULL-terminated string

<b>NOTE:</b> if the channel has no name, NULL is returned.  


refid: gaee333f1061000b0b71298dff59104513
name: iio_channel_is_output
definition: bool iio_channel_is_output
type: bool
argsstring: (const struct iio_channel *chn)
briefdescription: Return True if the given channel is an output channel.
detaileddescription:
@param chn A pointer to an iio_channel structure
@return True if the channel is an output channel, False otherwise  


refid: gad49fb1449e6ed6a42db71696676fd2d3
name: iio_channel_is_scan_element
definition: bool iio_channel_is_scan_element
type: bool
argsstring: (const struct iio_channel *chn)
briefdescription: Return True if the given channel is a scan element.
detaileddescription:
@param chn A pointer to an iio_channel structure
@return True if the channel is a scan element, False otherwise

<b>NOTE:</b> a channel that is a scan element is a channel that can
generate samples (for an input channel) or receive samples (for an output
channel) after being enabled.  


refid: ga0d9e98519d12fc02a17a3f47011321fb
name: iio_channel_get_attrs_count
definition: unsigned int iio_channel_get_attrs_count
type: unsigned int
argsstring: (const struct iio_channel *chn)
briefdescription: Enumerate the channel-specific attributes of the given channel.
detaileddescription:
@param chn A pointer to an iio_channel structure
@return The number of channel-specific attributes found  


refid: gafd133e49a1a694e394939b4c5a073cb5
name: iio_channel_get_attr
definition: const char* iio_channel_get_attr
type: const char *
argsstring: (const struct iio_channel *chn, unsigned int index)
briefdescription: Get the channel-specific attribute present at the given index.
detaileddescription:
@param chn A pointer to an iio_channel structure
@param index The index corresponding to the attribute
@return On success, a pointer to a static NULL-terminated string
@return If the index is invalid, NULL is returned  


refid: ga64cd8c18fdc14a9a5fb21d955fa99b35
name: iio_channel_find_attr
definition: const char* iio_channel_find_attr
type: const char *
argsstring: (const struct iio_channel *chn, const char *name)
briefdescription: Try to find a channel-specific attribute by its name.
detaileddescription:
@param chn A pointer to an iio_channel structure
@param name A NULL-terminated string corresponding to the name of the
attribute
@return On success, a pointer to a static NULL-terminated string
@return If the name does not correspond to any known attribute of the given
channel, NULL is returned

<b>NOTE:</b> This function is useful to detect the presence of an attribute.
It can also be used to retrieve the name of an attribute as a pointer to a
static string from a dynamically allocated string.  


refid: gacb37ef830dcc100a9908d0592d1ff190
name: iio_channel_attr_read
definition: ssize_t iio_channel_attr_read
type: ssize_t
argsstring: (const struct iio_channel *chn, const char *attr, char *dst, size_t len)
briefdescription: Read the content of the given channel-specific attribute.
detaileddescription:
@param chn A pointer to an iio_channel structure
@param attr A NULL-terminated string corresponding to the name of the
attribute
@param dst A pointer to the memory area where the NULL-terminated string
corresponding to the value read will be stored
@param len The available length of the memory area, in bytes
@return On success, the number of bytes written to the buffer
@return On error, a negative errno code is returned

<b>NOTE:</b>By passing NULL as the "attr" argument to iio_channel_attr_read,
it is now possible to read all of the attributes of a channel.

The buffer is filled with 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, it corresponds to the errno code that were
returned when reading the attribute; if positive, it corresponds to the
length of the data read. In that case, the rest of the block contains
the data.  


refid: ga0073a46392fcf6efaa488b75cf8bcb6c
name: iio_channel_attr_write_raw
definition: ssize_t iio_channel_attr_write_raw
type: ssize_t
argsstring: (const struct iio_channel *chn, const char *attr, const void *src, size_t len)
briefdescription: Set the value of the given channel-specific attribute.
detaileddescription:
@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 pointer to the data to be written
@param len The number of bytes that should be written
@return On success, the number of bytes written
@return On error, a negative errno code is returned  


refid: ga68c8e6c772dbf4bbec921c1dc050ab3e
name: iio_channel_attr_write
definition: ssize_t iio_channel_attr_write
type: ssize_t
argsstring: (const struct iio_channel *chn, const char *attr, const char *src)
briefdescription: Set the value of the given channel-specific attribute.
detaileddescription:
@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

<b>NOTE:</b>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.  


refid: gacbce92eaefb8d61c1e4f0dc042b211e6
name: iio_channel_get_data
definition: void* iio_channel_get_data
type: void *
argsstring: (const struct iio_channel *chn)
briefdescription: Retrieve a previously associated pointer of an iio_channel structure.
detaileddescription:
@param chn A pointer to an iio_channel structure
@return The pointer previously associated if present, or NULL  


refid: gafbee3b65c633063ca9ca281dba4a03d9
name: iio_channel_get_index
definition: long iio_channel_get_index
type: long
argsstring: (const struct iio_channel *chn)
briefdescription: Get the index of the given channel.
detaileddescription:
@param chn A pointer to an iio_channel structure
@return On success, the index of the specified channel
@return On error, a negative errno code is returned  


refid: gabd89c820b3e14e6a79466b896de89293
name: iio_channel_get_data_format
definition: const struct iio_data_format* iio_channel_get_data_format
type: const struct iio_data_format *
argsstring: (const struct iio_channel *chn)
briefdescription: Get a pointer to a channel's data format structure.
detaileddescription:
@param chn A pointer to an iio_channel structure
@return A pointer to the channel's iio_data_format structure  


refid: ga06d2d53147ee7e028da0092350efc22c
name: iio_channel_is_enabled
definition: bool iio_channel_is_enabled
type: bool
argsstring: (const struct iio_channel *chn)
briefdescription: Returns True if the channel is enabled.
detaileddescription:
@param chn A pointer to an iio_channel structure
@return True if the channel is enabled, False otherwise  


refid: ga2b787983683d37966b5e1e5c6c121d6a
name: iio_channel_enable
definition: void iio_channel_enable
type: void
argsstring: (struct iio_channel *chn)
briefdescription: Enable the given channel.
detaileddescription:
@param chn A pointer to an iio_channel structure

<b>NOTE:</b>Before creating an iio_buffer structure with
iio_device_create_buffer, it is required to enable at least one channel of
the device to read from.  


refid: gaf910dce06335badc1ba307526c4112a6
name: iio_channel_convert
definition: void iio_channel_convert
type: void
argsstring: (const struct iio_channel *chn, void *dst, const void *src)
briefdescription: Convert the sample from hardware format to host format.
detaileddescription:
@param chn A pointer to an iio_channel structure
@param dst A pointer to the destination buffer where the converted sample
should be written
@param src A pointer to the source buffer containing the sample  


refid: gabf4e2755877dedae40a5fbeb54a3829e
name: iio_channel_read_raw
definition: size_t iio_channel_read_raw
type: size_t
argsstring: (const struct iio_channel *chn, struct iio_buffer *buf, void *dst, size_t len)
detaileddescription:
 Demultiplex the samples of a given channel
@param chn A pointer to an iio_channel structure
@param buffer A pointer to an iio_buffer structure
@param dst A pointer to the memory area where the demultiplexed data will be
stored
@param len The available length of the memory area, in bytes
@return The size of the demultiplexed data, in bytes  


refid: gaa35f0bbf7f6be8f859adb3fc692c600e
name: iio_channel_read
definition: size_t iio_channel_read
type: size_t
argsstring: (const struct iio_channel *chn, struct iio_buffer *buf, void *dst, size_t len)
detaileddescription:
 Demultiplex and convert the samples of a given channel
@param chn A pointer to an iio_channel structure
@param buffer A pointer to an iio_buffer structure
@param dst A pointer to the memory area where the converted data will be
stored
@param len The available length of the memory area, in bytes
@return The size of the converted data, in bytes  


refid: ga0d06dce5819723c3b16c4588eb5f477a
name: iio_channel_write_raw
definition: size_t iio_channel_write_raw
type: size_t
argsstring: (const struct iio_channel *chn, struct iio_buffer *buf, const void *src, size_t len)
detaileddescription:
 Multiplex the samples of a given channel
@param chn A pointer to an iio_channel structure
@param buffer A pointer to an iio_buffer structure
@param src A pointer to the memory area where the sequential data will
be read from
@param len The length of the memory area, in bytes
@return The number of bytes actually multiplexed  


refid: ga343be1b2a9b4a23aa1ad6e22b5b334b3
name: iio_channel_write
definition: size_t iio_channel_write
type: size_t
argsstring: (const struct iio_channel *chn, struct iio_buffer *buf, const void *src, size_t len)
detaileddescription:
 Convert and multiplex the samples of a given channel
@param chn A pointer to an iio_channel structure
@param buffer A pointer to an iio_buffer structure
@param src A pointer to the memory area where the sequential data will
be read from
@param len The length of the memory area, in bytes
@return The number of bytes actually converted and multiplexed  


refid: ga8c5fc6f7ccee7f9da338833822f799ec
name: iio_channel_attr_read_longlong
definition: int iio_channel_attr_read_longlong
type: int
argsstring: (const struct iio_channel *chn, const char *attr, long long *val)
briefdescription: Read the content of the given channel-specific attribute.
detaileddescription:
@param chn A pointer to an iio_channel structure
@param attr A NULL-terminated string corresponding to the name of the
attribute
@param val A pointer to a long long variable where the value should be stored
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: gabcd0cd25e203976bdc525790b6fe4e23
name: iio_channel_attr_read_bool
definition: int iio_channel_attr_read_bool
type: int
argsstring: (const struct iio_channel *chn, const char *attr, bool *val)
briefdescription: Read the content of the given channel-specific attribute.
detaileddescription:
@param chn A pointer to an iio_channel structure
@param attr A NULL-terminated string corresponding to the name of the
attribute
@param val A pointer to a bool variable where the value should be stored
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: ga823b2e43e8d1bc0122266e83fe81fbc4
name: iio_channel_attr_read_double
definition: int iio_channel_attr_read_double
type: int
argsstring: (const struct iio_channel *chn, const char *attr, double *val)
briefdescription: Read the content of the given channel-specific attribute.
detaileddescription:
@param chn A pointer to an iio_channel structure
@param attr A NULL-terminated string corresponding to the name of the
attribute
@param val A pointer to a double variable where the value should be stored
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: ga3c86ab8607c4ae38e2a36fa8c6bedcfd
name: iio_channel_attr_write_longlong
definition: int iio_channel_attr_write_longlong
type: int
argsstring: (const struct iio_channel *chn, const char *attr, long long val)
briefdescription: Set the value of the given channel-specific attribute.
detaileddescription:
@param chn A pointer to an iio_channel structure
@param attr A NULL-terminated string corresponding to the name of the
attribute
@param val A long long value to set the attribute to
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: ga8dd9233a125c95969dac270b4dd5e8b0
name: iio_channel_attr_write_double
definition: int iio_channel_attr_write_double
type: int
argsstring: (const struct iio_channel *chn, const char *attr, double val)
briefdescription: Set the value of the given channel-specific attribute.
detaileddescription:
@param chn A pointer to an iio_channel structure
@param attr A NULL-terminated string corresponding to the name of the
attribute
@param val A double value to set the attribute to
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: gaa08ea63cf2ed45b5d47deb14019e12bf
name: iio_channel_attr_write_bool
definition: int iio_channel_attr_write_bool
type: int
argsstring: (const struct iio_channel *chn, const char *attr, bool val)
briefdescription: Set the value of the given channel-specific attribute.
detaileddescription:
@param chn A pointer to an iio_channel structure
@param attr A NULL-terminated string corresponding to the name of the
attribute
@param val A bool value to set the attribute to
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: gaaf827107e626bb6677209a6f3192ed37
name: iio_channel_attr_get_filename
definition: const char* iio_channel_attr_get_filename
type: const char *
argsstring: (const struct iio_channel *chn, const char *attr)
briefdescription: Retrieve the filename of an attribute.
detaileddescription:
@param chn A pointer to an iio_channel structure
@param attr a NULL-terminated string corresponding to the name of the
attribute
@return On success, a pointer to a static NULL-terminated string
@return If the attribute name is unknown, NULL is returned  


refid: ga66bdc45f6b55cd28e76945ead18686ca
name: iio_channel_attr_read_all
definition: int iio_channel_attr_read_all
type: int
briefdescription: Read the content of all channel-specific attributes.
argsstring:
(struct iio_channel *chn, int(*cb)(struct iio_channel *chn, const char *attr, const char *val, size_t len, void *d), void *data)

detaileddescription:
@param chn A pointer to an iio_channel structure
@param cb A pointer to a callback function
@param data A pointer that will be passed to the callback function
@return On success, 0 is returned
@return On error, a negative errno code is returned

<b>NOTE:</b> This function is especially useful when used with the network
backend, as all the channel-specific attributes are read in one single
command.  


refid: ga0430f53a97a6fe7474416d7e2b228421
name: iio_channel_attr_write_all
definition: int iio_channel_attr_write_all
type: int
briefdescription: Set the values of all channel-specific attributes.
argsstring:
(struct iio_channel *chn, ssize_t(*cb)(struct iio_channel *chn, const char *attr, void *buf, size_t len, void *d), void *data)

detaileddescription:
@param chn A pointer to an iio_channel structure
@param cb A pointer to a callback function
@param data A pointer that will be passed to the callback function
@return On success, 0 is returned
@return On error, a negative errno code is returned

<b>NOTE:</b> This function is especially useful when used with the network
backend, as all the channel-specific attributes are written in one single
command.  


refid: aa1465f1bfbb290be9a1aac762d4d002e
name: xml_header
definition: const char xml_header[]
type: const char
argsstring: []
initializer:
= "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
"<!DOCTYPE context ["
"<!ELEMENT context (device | context-attribute)*>"
"<!ELEMENT context-attribute EMPTY>"
"<!ELEMENT device (channel | attribute | debug-attribute)*>"
"<!ELEMENT channel (scan-element?, attribute*)>"
"<!ELEMENT attribute EMPTY>"
"<!ELEMENT scan-element EMPTY>"
"<!ELEMENT debug-attribute EMPTY>"
"<!ATTLIST context name CDATA #REQUIRED description CDATA #IMPLIED>"
"<!ATTLIST context-attribute name CDATA #REQUIRED value CDATA #REQUIRED>"
"<!ATTLIST device id CDATA #REQUIRED name CDATA #IMPLIED>"
"<!ATTLIST channel id CDATA #REQUIRED type (input|output) #REQUIRED name CDATA #IMPLIED>"
"<!ATTLIST scan-element index CDATA #REQUIRED format CDATA #REQUIRED scale CDATA #IMPLIED>"
"<!ATTLIST attribute name CDATA #REQUIRED filename CDATA #IMPLIED>"
"<!ATTLIST debug-attribute name CDATA #REQUIRED>"
"]>"


refid: ga8fd307456f2667ff0c79dc87d0b6d37f
name: iio_context_get_xml
definition: const char* iio_context_get_xml
type: const char *
argsstring: (const struct iio_context *ctx)
briefdescription: Obtain a XML representation of the given context.
detaileddescription:
@param ctx A pointer to an iio_context structure
@return A pointer to a static NULL-terminated string  


refid: gaa07d9c8e3730ae646fb54cbbd4368101
name: iio_context_get_name
definition: const char* iio_context_get_name
type: const char *
argsstring: (const struct iio_context *ctx)
briefdescription: Get the name of the given context.
detaileddescription:
@param ctx A pointer to an iio_context structure
@return A pointer to a static NULL-terminated string

<b>NOTE:</b>The returned string will be <b><i>local</i></b>,
<b><i>xml</i></b> or <b><i>network</i></b> when the context has been
created with the local, xml and network backends respectively. 


refid: ga5adbbac8ca9f6e6798f8904cfe6d7a1c
name: iio_context_get_description
definition: const char* iio_context_get_description
type: const char *
argsstring: (const struct iio_context *ctx)
briefdescription: Get a description of the given context.
detaileddescription:
@param ctx A pointer to an iio_context structure
@return A pointer to a static NULL-terminated string

<b>NOTE:</b>The returned string will contain human-readable information about
the current context.  


refid: ga75de8dae515c539818e52b408830d3ba
name: iio_context_destroy
definition: void iio_context_destroy
type: void
argsstring: (struct iio_context *ctx)
briefdescription: Destroy the given context.
detaileddescription:
@param ctx A pointer to an iio_context structure

<b>NOTE:</b> After that function, the iio_context pointer shall be invalid.  


refid: ga146121adb7288ba44174cf6466922212
name: iio_context_get_device
definition: struct iio_device* iio_context_get_device
type: struct iio_device *
argsstring: (const struct iio_context *ctx, unsigned int index)
briefdescription: Get the device present at the given index.
detaileddescription:
@param ctx A pointer to an iio_context structure
@param index The index corresponding to the device
@return On success, a pointer to an iio_device structure
@return If the index is invalid, NULL is returned  


refid: gae5807303b638869679ece67270e72e77
name: iio_context_find_device
definition: struct iio_device* iio_context_find_device
type: struct iio_device *
argsstring: (const struct iio_context *ctx, const char *name)
briefdescription: Try to find a device structure by its name of ID.
detaileddescription:
@param ctx A pointer to an iio_context structure
@param name A NULL-terminated string corresponding to the name or the ID of
the device to search for
@return On success, a pointer to an iio_device structure
@return If the name or ID does not correspond to any known device, NULL is
returned  


refid: ga04957021a00fb18689b9d9ae6f95a928
name: iio_context_get_version
definition: int iio_context_get_version
type: int
argsstring: (const struct iio_context *ctx, unsigned int *major, unsigned int *minor, char git_tag[8])
briefdescription: Get the version of the backend in use.
detaileddescription:
@param ctx A pointer to an iio_context structure
@param major A pointer to an unsigned integer (NULL accepted)
@param minor A pointer to an unsigned integer (NULL accepted)
@param git_tag A pointer to a 8-characters buffer (NULL accepted)
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: gabc9a33ab04950491c6c19d7da1138b39
name: iio_context_set_timeout
definition: int iio_context_set_timeout
type: int
argsstring: (struct iio_context *ctx, unsigned int timeout)
briefdescription: Set a timeout for I/O operations.
detaileddescription:
@param ctx A pointer to an iio_context structure
@param 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.
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: gafa20455bf17c9fccf9f83bcec3605f37
name: iio_context_clone
definition: struct iio_context* iio_context_clone
type: struct iio_context *
argsstring: (const struct iio_context *ctx)
briefdescription: Duplicate a pre-existing IIO context.
detaileddescription:
@param ctx A pointer to an iio_context structure
@return On success, A pointer to an iio_context structure
@return On failure, NULL is returned and errno is set appropriately  


refid: ga5cc6251fbf69e26befccb82d5f5a6625
name: iio_create_context_from_uri
definition: struct iio_context* iio_create_context_from_uri
type: struct iio_context *
argsstring: (const char *uri)
briefdescription: Create a context from a URI description.
detaileddescription:
@param uri A URI describing the context location
@return On success, a pointer to a iio_context structure
@return On failure, NULL is returned and errno is set appropriately  


refid: ga5f18bbe6c9e1993f26480f73f92e1ad5
name: iio_create_default_context
definition: struct iio_context* iio_create_default_context
type: struct iio_context *
argsstring: (void)
briefdescription: Create a context from local or remote IIO devices.
detaileddescription:
@return On success, A pointer to an iio_context structure
@return On failure, NULL is returned and errno is set appropriately

<b>NOTE:</b> This function will create a network context if the IIOD_REMOTE
environment variable is set to the hostname where the IIOD server runs. If
set to an empty string, the server will be discovered using ZeroConf.
If the environment variable is not set, a local context will be created
instead.  


refid: ga4aafea4c127b872d5214d41ccb4ce8c1
name: iio_create_local_context
definition: struct iio_context* iio_create_local_context
type: struct iio_context *
argsstring: (void)
briefdescription: Create a context from local IIO devices (Linux only)
detaileddescription:
@return On success, A pointer to an iio_context structure
@return On failure, NULL is returned and errno is set appropriately  


refid: gabb89575442d19f28b6557eee97f8fafd
name: iio_create_network_context
definition: struct iio_context* iio_create_network_context
type: struct iio_context *
argsstring: (const char *hostname)
briefdescription: Create a context from the network.
detaileddescription:
@param host Hostname, IPv4 or IPv6 address where the IIO Daemon is running
@return On success, a pointer to an iio_context structure
@return On failure, NULL is returned and errno is set appropriately  


refid: ga5e8df4d94cd89374cd59611a70cfc6c4
name: iio_create_xml_context_mem
definition: struct iio_context* iio_create_xml_context_mem
type: struct iio_context *
argsstring: (const char *xml, size_t len)
briefdescription: Create a context from XML data in memory.
detaileddescription:
@param xml Pointer to the XML data in memory
@param len Length of the XML string in memory (excluding the final \0)
@return On success, A pointer to an iio_context structure
@return On failure, NULL is returned and errno is set appropriately

<b>NOTE:</b> The format of the XML must comply to the one returned by
iio_context_get_xml  


refid: ga5f1aef2258268209b6486e788a1967ec
name: iio_create_xml_context
definition: struct iio_context* iio_create_xml_context
type: struct iio_context *
argsstring: (const char *xml_file)
briefdescription: Create a context from a XML file.
detaileddescription:
@param xml_file Path to the XML file to open
@return On success, A pointer to an iio_context structure
@return On failure, NULL is returned and errno is set appropriately

<b>NOTE:</b> The format of the XML must comply to the one returned by
iio_context_get_xml.  


refid: ga43b3d80fdae82628d54398cf39cc351d
name: iio_context_get_attrs_count
definition: unsigned int iio_context_get_attrs_count
type: unsigned int
argsstring: (const struct iio_context *ctx)
briefdescription: Get the number of context-specific attributes.
detaileddescription:
@param ctx A pointer to an iio_context structure
@return The number of context-specific attributes

Introduced in version 0.9.  


refid: ga30cc0f5ffa30537bb97021a5798328e9
name: iio_context_get_attr
definition: int iio_context_get_attr
type: int
argsstring: (const struct iio_context *ctx, unsigned int index, const char **name, const char **value)
briefdescription: Retrieve the name and value of a context-specific attribute.
detaileddescription:
@param ctx A pointer to an iio_context structure
@param index The index corresponding to the attribute
@param name A pointer to a const char * pointer (NULL accepted)
@param value A pointer to a const char * pointer (NULL accepted)
@return On success, 0 is returned
@return On error, a negative errno code is returned

Introduced in version 0.9.  


refid: ga7d11f631fcb2ca8e1bf918553bbb9938
name: iio_context_get_attr_value
definition: const char* iio_context_get_attr_value
type: const char *
argsstring: (const struct iio_context *ctx, const char *name)
briefdescription: Retrieve the value of a context-specific attribute.
detaileddescription:
@param ctx A pointer to an iio_context structure
@param name The name of the context attribute to read
@return On success, a pointer to a static NULL-terminated string
@return If the name does not correspond to any attribute, NULL is
returned

Introduced in version 0.9.  


refid: ga233b868380bca0578907bda28d3a5480
name: iio_device_get_id
definition: const char* iio_device_get_id
type: const char *
argsstring: (const struct iio_device *dev)
briefdescription: Retrieve the device ID (e.g. <b><i>iio:device0</i></b>)
detaileddescription:
@param dev A pointer to an iio_device structure
@return A pointer to a static NULL-terminated string  


refid: gae7adad053ab5e2a5f447851f7d34dc04
name: iio_device_get_name
definition: const char* iio_device_get_name
type: const char *
argsstring: (const struct iio_device *dev)
briefdescription: Retrieve the device name (e.g. <b><i>xadc</i></b>)
detaileddescription:
@param dev A pointer to an iio_device structure
@return A pointer to a static NULL-terminated string

<b>NOTE:</b> if the device has no name, NULL is returned.  


refid: ga853334a4cfa9a0b39e93ac78455b83fd
name: iio_device_get_channel
definition: struct iio_channel* iio_device_get_channel
type: struct iio_channel *
argsstring: (const struct iio_device *dev, unsigned int index)
briefdescription: Get the channel present at the given index.
detaileddescription:
@param dev A pointer to an iio_device structure
@param index The index corresponding to the channel
@return On success, a pointer to an iio_channel structure
@return If the index is invalid, NULL is returned  


refid: gacf9fe193b8183df86eab56df7da7361d
name: iio_device_find_channel
definition: struct iio_channel* iio_device_find_channel
type: struct iio_channel *
argsstring: (const struct iio_device *dev, const char *name, bool output)
briefdescription: Try to find a channel structure by its name of ID.
detaileddescription:
@param dev A pointer to an iio_device structure
@param name A NULL-terminated string corresponding to the name or the ID of
the channel to search for
@param output True if the searched channel is output, False otherwise
@return On success, a pointer to an iio_channel structure
@return If the name or ID does not correspond to any known channel of the
given device, NULL is returned  


refid: ga5cea41d7dd9babf48937e939aa0d3c5b
name: iio_device_get_attrs_count
definition: unsigned int iio_device_get_attrs_count
type: unsigned int
argsstring: (const struct iio_device *dev)
briefdescription: Enumerate the device-specific attributes of the given device.
detaileddescription:
@param dev A pointer to an iio_device structure
@return The number of device-specific attributes found  


refid: ga9f864d556e8089450a3062fd7f184041
name: iio_device_get_attr
definition: const char* iio_device_get_attr
type: const char *
argsstring: (const struct iio_device *dev, unsigned int index)
briefdescription: Get the device-specific attribute present at the given index.
detaileddescription:
@param dev A pointer to an iio_device structure
@param index The index corresponding to the attribute
@return On success, a pointer to a static NULL-terminated string
@return If the index is invalid, NULL is returned  


refid: gac4b901fc37d404235e2b836d472cd3a4
name: iio_device_find_attr
definition: const char* iio_device_find_attr
type: const char *
argsstring: (const struct iio_device *dev, const char *name)
briefdescription: Try to find a device-specific attribute by its name.
detaileddescription:
@param dev A pointer to an iio_device structure
@param name A NULL-terminated string corresponding to the name of the
attribute
@return On success, a pointer to a static NULL-terminated string
@return If the name does not correspond to any known attribute of the given
device, NULL is returned

<b>NOTE:</b> This function is useful to detect the presence of an attribute.
It can also be used to retrieve the name of an attribute as a pointer to a
static string from a dynamically allocated string.  


refid: ga891aa6ffd6290fc3848e4f14a923d1fb
name: iio_device_find_debug_attr
definition: const char* iio_device_find_debug_attr
type: const char *
argsstring: (const struct iio_device *dev, const char *name)
briefdescription: Try to find a debug attribute by its name.
detaileddescription:
@param dev A pointer to an iio_device structure
@param name A NULL-terminated string corresponding to the name of the
debug attribute
@return On success, a pointer to a static NULL-terminated string
@return If the name does not correspond to any known debug attribute of the
given device, NULL is returned

<b>NOTE:</b> This function is useful to detect the presence of a debug
attribute.
It can also be used to retrieve the name of a debug attribute as a pointer
to a static string from a dynamically allocated string.  


refid: gacf36dfa2fc04a80ce93db3b131bae099
name: iio_device_attr_read
definition: ssize_t iio_device_attr_read
type: ssize_t
argsstring: (const struct iio_device *dev, const char *attr, char *dst, size_t len)
briefdescription: Read the content of the given device-specific attribute.
detaileddescription:
@param dev A pointer to an iio_device structure
@param attr A NULL-terminated string corresponding to the name of the
attribute
@param dst A pointer to the memory area where the NULL-terminated string
corresponding to the value read will be stored
@param len The available length of the memory area, in bytes
@return On success, the number of bytes written to the buffer
@return On error, a negative errno code is returned

<b>NOTE:</b>By passing NULL as the "attr" argument to iio_device_attr_read,
it is now possible to read all of the attributes of a device.

The buffer is filled with one block of data per attribute of the device,
by the order they appear in the iio_device structure.

The first four bytes of one block correspond to a 32-bit signed value in
network order. If negative, it corresponds to the errno code that were
returned when reading the attribute; if positive, it corresponds to the
length of the data read. In that case, the rest of the block contains
the data.  


refid: ga68819e214490f2d556599ee64799e267
name: iio_device_attr_write_raw
definition: ssize_t iio_device_attr_write_raw
type: ssize_t
argsstring: (const struct iio_device *dev, const char *attr, const void *src, size_t len)
briefdescription: Set the value of the given device-specific attribute.
detaileddescription:
@param dev A pointer to an iio_device structure
@param attr A NULL-terminated string corresponding to the name of the
attribute
@param src A pointer to the data to be written
@param len The number of bytes that should be written
@return On success, the number of bytes written
@return On error, a negative errno code is returned  


refid: ga3baae3a4b76956f9a7bc31c2ebb5b682
name: iio_device_attr_write
definition: ssize_t iio_device_attr_write
type: ssize_t
argsstring: (const struct iio_device *dev, const char *attr, const char *src)
briefdescription: Set the value of the given device-specific attribute.
detaileddescription:
@param dev A pointer to an iio_device 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

<b>NOTE:</b>By passing NULL as the "attr" argument to iio_device_attr_write,
it is now possible to write all of the attributes of a device.

The buffer must contain one block of data per attribute of the device,
by the order they appear in the iio_device 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.  


refid: ga87cff8d90e1a68e73410e4a527cc5334
name: iio_device_get_data
definition: void* iio_device_get_data
type: void *
argsstring: (const struct iio_device *dev)
briefdescription: Retrieve a previously associated pointer of an iio_device structure.
detaileddescription:
@param dev A pointer to an iio_device structure
@return The pointer previously associated if present, or NULL  


refid: ga41582140b8e1fe98148e51ae1350b816
name: iio_device_is_trigger
definition: bool iio_device_is_trigger
type: bool
argsstring: (const struct iio_device *dev)
briefdescription: Return True if the given device is a trigger.
detaileddescription:
@param dev A pointer to an iio_device structure
@return True if the device is a trigger, False otherwise  


refid: gabda6d5a2ce3500204a022702c3c925fe
name: iio_device_set_kernel_buffers_count
definition: int iio_device_set_kernel_buffers_count
type: int
argsstring: (const struct iio_device *dev, unsigned int nb_buffers)
briefdescription: Configure the number of kernel buffers for a device.
detaileddescription:
This function allows to change the number of buffers on kernel side.
@param dev A pointer to an iio_device structure
@param nb_buffers The number of buffers
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: ga9aa22c64b900bf6949a54816a04e7a87
name: iio_device_get_trigger
definition: int iio_device_get_trigger
type: int
argsstring: (const struct iio_device *dev, const struct iio_device **trigger)
briefdescription: Retrieve the trigger of a given device.
detaileddescription:
@param dev A pointer to an iio_device structure
@param trigger a pointer to a pointer of an iio_device structure. The pointed
pointer will be set to the address of the iio_device structure corresponding
to the associated trigger device.
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: ga30151c105a19b3fc3ad6376046d60bf9
name: iio_device_set_trigger
definition: int iio_device_set_trigger
type: int
argsstring: (const struct iio_device *dev, const struct iio_device *trigger)
briefdescription: Associate a trigger to a given device.
detaileddescription:
@param dev A pointer to an iio_device structure
@param trigger a pointer to the iio_device structure corresponding to the
trigger that should be associated.
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: ga6ecca643c857855e8aa27fee21553337
name: iio_device_get_sample_size
definition: ssize_t iio_device_get_sample_size
type: ssize_t
argsstring: (const struct iio_device *dev)
briefdescription: Get the current sample size.
detaileddescription:
@param dev A pointer to an iio_device structure
@return On success, the sample size in bytes
@return On error, a negative errno code is returned

<b>NOTE:</b> The sample size is not constant and will change when channels
get enabled or disabled.  


refid: gace7a0de3e19a58c38f23e2a9b444dfff
name: iio_device_attr_read_longlong
definition: int iio_device_attr_read_longlong
type: int
argsstring: (const struct iio_device *dev, const char *attr, long long *val)
briefdescription: Read the content of the given device-specific attribute.
detaileddescription:
@param dev A pointer to an iio_device structure
@param attr A NULL-terminated string corresponding to the name of the
attribute
@param val A pointer to a long long variable where the value should be stored
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: ga81493a122a9da884af36d087cbc80614
name: iio_device_attr_read_bool
definition: int iio_device_attr_read_bool
type: int
argsstring: (const struct iio_device *dev, const char *attr, bool *val)
briefdescription: Read the content of the given device-specific attribute.
detaileddescription:
@param dev A pointer to an iio_device structure
@param attr A NULL-terminated string corresponding to the name of the
attribute
@param val A pointer to a bool variable where the value should be stored
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: gaeb192bd3730c8c65a4e5c29feca62257
name: iio_device_attr_read_double
definition: int iio_device_attr_read_double
type: int
argsstring: (const struct iio_device *dev, const char *attr, double *val)
briefdescription: Read the content of the given device-specific attribute.
detaileddescription:
@param dev A pointer to an iio_device structure
@param attr A NULL-terminated string corresponding to the name of the
attribute
@param val A pointer to a double variable where the value should be stored
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: ga176d11776f916c8148c6dfa1368cea3c
name: iio_device_attr_write_longlong
definition: int iio_device_attr_write_longlong
type: int
argsstring: (const struct iio_device *dev, const char *attr, long long val)
briefdescription: Set the value of the given device-specific attribute.
detaileddescription:
@param dev A pointer to an iio_device structure
@param attr A NULL-terminated string corresponding to the name of the
attribute
@param val A long long value to set the attribute to
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: ga638c2f54b187a1b137f9885f34fad338
name: iio_device_attr_write_double
definition: int iio_device_attr_write_double
type: int
argsstring: (const struct iio_device *dev, const char *attr, double val)
briefdescription: Set the value of the given device-specific attribute.
detaileddescription:
@param dev A pointer to an iio_device structure
@param attr A NULL-terminated string corresponding to the name of the
attribute
@param val A double value to set the attribute to
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: gae3a265d5053a2cac254eb59a8eeda9da
name: iio_device_attr_write_bool
definition: int iio_device_attr_write_bool
type: int
argsstring: (const struct iio_device *dev, const char *attr, bool val)
briefdescription: Set the value of the given device-specific attribute.
detaileddescription:
@param dev A pointer to an iio_device structure
@param attr A NULL-terminated string corresponding to the name of the
attribute
@param val A bool value to set the attribute to
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: ga2ae0fe2e179de9f6de10900f72fc28be
name: iio_device_debug_attr_read
definition: ssize_t iio_device_debug_attr_read
type: ssize_t
argsstring: (const struct iio_device *dev, const char *attr, char *dst, size_t len)
briefdescription: Read the content of the given debug attribute.
detaileddescription:
@param dev A pointer to an iio_device structure
@param attr A NULL-terminated string corresponding to the name of the
debug attribute
@param dst A pointer to the memory area where the NULL-terminated string
corresponding to the value read will be stored
@param len The available length of the memory area, in bytes
@return On success, the number of bytes written to the buffer
@return On error, a negative errno code is returned

<b>NOTE:</b>By passing NULL as the "attr" argument to
iio_device_debug_attr_read, it is now possible to read all of the debug
attributes of a device.

The buffer is filled with one block of data per debug attribute of the
device, by the order they appear in the iio_device structure.

The first four bytes of one block correspond to a 32-bit signed value in
network order. If negative, it corresponds to the errno code that were
returned when reading the debug attribute; if positive, it corresponds
to the length of the data read. In that case, the rest of the block contains
the data.  


refid: gaabf46f157171dead5bf1f0a3da1aab93
name: iio_device_debug_attr_write_raw
definition: ssize_t iio_device_debug_attr_write_raw
type: ssize_t
argsstring: (const struct iio_device *dev, const char *attr, const void *src, size_t len)
briefdescription: Set the value of the given debug attribute.
detaileddescription:
@param dev A pointer to an iio_device structure
@param attr A NULL-terminated string corresponding to the name of the
debug attribute
@param src A pointer to the data to be written
@param len The number of bytes that should be written
@return On success, the number of bytes written
@return On error, a negative errno code is returned  


refid: ga01151f264c7e22fcf8390b5303b51bb3
name: iio_device_debug_attr_write
definition: ssize_t iio_device_debug_attr_write
type: ssize_t
argsstring: (const struct iio_device *dev, const char *attr, const char *src)
briefdescription: Set the value of the given debug attribute.
detaileddescription:
@param dev A pointer to an iio_device structure
@param attr A NULL-terminated string corresponding to the name of the
debug attribute
@param src A NULL-terminated string to set the debug attribute to
@return On success, the number of bytes written
@return On error, a negative errno code is returned

<b>NOTE:</b>By passing NULL as the "attr" argument to
iio_device_debug_attr_write, it is now possible to write all of the
debug attributes of a device.

The buffer must contain one block of data per debug attribute of the device,
by the order they appear in the iio_device structure.

The first four bytes of one block correspond to a 32-bit signed value in
network order. If negative, the debug 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.  


refid: gaf64c20583fd66701afcc6c7ba3deb6ea
name: iio_device_get_debug_attr
definition: const char* iio_device_get_debug_attr
type: const char *
argsstring: (const struct iio_device *dev, unsigned int index)
briefdescription: Get the debug attribute present at the given index.
detaileddescription:
@param dev A pointer to an iio_device structure
@param index The index corresponding to the debug attribute
@return On success, a pointer to a static NULL-terminated string
@return If the index is invalid, NULL is returned  


refid: gac43421333d85b03e7aeb31eb60a676fe
name: iio_device_debug_attr_read_longlong
definition: int iio_device_debug_attr_read_longlong
type: int
argsstring: (const struct iio_device *dev, const char *attr, long long *val)
briefdescription: Read the content of the given debug attribute.
detaileddescription:
@param dev A pointer to an iio_device structure
@param attr A NULL-terminated string corresponding to the name of the
debug attribute
@param val A pointer to a long long variable where the value should be stored
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: gac2d887e2f77423596487302d2728c99e
name: iio_device_debug_attr_read_bool
definition: int iio_device_debug_attr_read_bool
type: int
argsstring: (const struct iio_device *dev, const char *attr, bool *val)
briefdescription: Read the content of the given debug attribute.
detaileddescription:
@param dev A pointer to an iio_device structure
@param attr A NULL-terminated string corresponding to the name of the
debug attribute
@param val A pointer to a bool variable where the value should be stored
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: ga01b435571a0bd034bc47987295821573
name: iio_device_debug_attr_read_double
definition: int iio_device_debug_attr_read_double
type: int
argsstring: (const struct iio_device *dev, const char *attr, double *val)
briefdescription: Read the content of the given debug attribute.
detaileddescription:
@param dev A pointer to an iio_device structure
@param attr A NULL-terminated string corresponding to the name of the
debug attribute
@param val A pointer to a double variable where the value should be stored
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: ga83e2e2ef3c9fa91561b41dd32c59194e
name: iio_device_debug_attr_write_longlong
definition: int iio_device_debug_attr_write_longlong
type: int
argsstring: (const struct iio_device *dev, const char *attr, long long val)
briefdescription: Set the value of the given debug attribute.
detaileddescription:
@param dev A pointer to an iio_device structure
@param attr A NULL-terminated string corresponding to the name of the
debug attribute
@param val A long long value to set the debug attribute to
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: ga1d105cd9079c1218c363db75cf504e0d
name: iio_device_debug_attr_write_double
definition: int iio_device_debug_attr_write_double
type: int
argsstring: (const struct iio_device *dev, const char *attr, double val)
briefdescription: Set the value of the given debug attribute.
detaileddescription:
@param dev A pointer to an iio_device structure
@param attr A NULL-terminated string corresponding to the name of the
debug attribute
@param val A double value to set the debug attribute to
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: ga2013f7206e2dde3aedee31ba01945585
name: iio_device_debug_attr_write_bool
definition: int iio_device_debug_attr_write_bool
type: int
argsstring: (const struct iio_device *dev, const char *attr, bool val)
briefdescription: Set the value of the given debug attribute.
detaileddescription:
@param dev A pointer to an iio_device structure
@param attr A NULL-terminated string corresponding to the name of the
debug attribute
@param val A bool value to set the debug attribute to
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: ga5b56ddbb739533dccd7054cd8842f7c0
name: iio_device_identify_filename
definition: int iio_device_identify_filename
type: int
argsstring: (const struct iio_device *dev, const char *filename, struct iio_channel **chn, const char **attr)
briefdescription: Identify the channel or debug attribute corresponding to a filename.
detaileddescription:
@param dev A pointer to an iio_device structure
@param filename A NULL-terminated string corresponding to the filename
@param chn A pointer to a pointer of an iio_channel structure. The pointed
pointer will be set to the address of the iio_channel structure if the
filename correspond to the attribute of a channel, or NULL otherwise.
@param attr A pointer to a NULL-terminated string. The pointer
pointer will be set to point to the name of the attribute corresponding to
the filename.
@return On success, 0 is returned, and *chn and *attr are modified.
@return On error, a negative errno code is returned. *chn and *attr are not
modified.  


refid: ga821ace05c0f77bf4f87be7555ae84d52
name: iio_device_reg_write
definition: int iio_device_reg_write
type: int
argsstring: (struct iio_device *dev, uint32_t address, uint32_t value)
briefdescription: Set the value of a hardware register.
detaileddescription:
@param dev A pointer to an iio_device structure
@param address The address of the register
@param value The value to set the register to
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: gaf549d2113214add88129493697cb3587
name: iio_device_reg_read
definition: int iio_device_reg_read
type: int
argsstring: (struct iio_device *dev, uint32_t address, uint32_t *value)
briefdescription: Get the value of a hardware register.
detaileddescription:
@param dev A pointer to an iio_device structure
@param address The address of the register
@param value A pointer to the variable where the value will be written
@return On success, 0 is returned
@return On error, a negative errno code is returned  


refid: a911dcf7c18bd22d96232bb3725c776b8
name: read_each_attr
definition: static int read_each_attr
type: int
argsstring:
(struct iio_device *dev, bool is_debug, int(*cb)(struct iio_device *dev, const char *attr, const char *val, size_t len, void *d), void *data)


refid: a02480c03debf0b6c02c06e1f8f103c10
name: write_each_attr
definition: static int write_each_attr
type: int
argsstring:
(struct iio_device *dev, bool is_debug, ssize_t(*cb)(struct iio_device *dev, const char *attr, void *buf, size_t len, void *d), void *data)


refid: abd2a2dd444d684ba92c67c3087078042
name: iio_device_debug_attr_read_all
definition: int iio_device_debug_attr_read_all
type: int
argsstring:
(struct iio_device *dev, int(*cb)(struct iio_device *dev, const char *attr, const char *val, size_t len, void *d), void *data)


refid: ga08b5346afb0498dc05b123097db1f364
name: iio_device_debug_attr_write_all
definition: int iio_device_debug_attr_write_all
type: int
briefdescription: Set the values of all debug attributes.
argsstring:
(struct iio_device *dev, ssize_t(*cb)(struct iio_device *dev, const char *attr, void *buf, size_t len, void *d), void *data)

detaileddescription:
@param dev A pointer to an iio_device structure
@param cb A pointer to a callback function
@param data A pointer that will be passed to the callback function
@return On success, 0 is returned
@return On error, a negative errno code is returned

<b>NOTE:</b> This function is especially useful when used with the network
backend, as all the debug attributes are written in one single command.  


refid: ga81b3ad843d0e4b2e8857c0205e9fbb07
name: iio_device_attr_write_all
definition: int iio_device_attr_write_all
type: int
briefdescription: Set the values of all device-specific attributes.
argsstring:
(struct iio_device *dev, ssize_t(*cb)(struct iio_device *dev, const char *attr, void *buf, size_t len, void *d), void *data)

detaileddescription:
@param dev A pointer to an iio_device structure
@param cb A pointer to a callback function
@param data A pointer that will be passed to the callback function
@return On success, 0 is returned
@return On error, a negative errno code is returned

<b>NOTE:</b> This function is especially useful when used with the network
backend, as all the device-specific attributes are written in one single
command.  


refid: a944ad22f426e09cdbb493081a05472e5
name: iio_modifier
briefdescription: IIO channel modifier.
detaileddescription:
In a addition to a type a IIO channel can optionally have a channel modifier
further specifying the data type of of the channel.


refid: gad40746585b3f8a77e5209301a9ad21cd
name: iio_create_scan_context
definition: __api struct iio_scan_context* iio_create_scan_context
type: __api struct iio_scan_context *
argsstring: (const char *backend, unsigned int flags)
briefdescription: Create a scan context.
detaileddescription:
@param backend A NULL-terminated string containing the backend to use for
scanning. If NULL, all the available backends are used.
@param flags Unused for now. Set to 0.
@return on success, a pointer to a iio_scan_context structure
@return On failure, NULL is returned and errno is set appropriately  


refid: ga649d7821636c744753067e8301a84e6d
name: iio_scan_context_destroy
definition: __api void iio_scan_context_destroy
type: __api void
argsstring: (struct iio_scan_context *ctx)
briefdescription: Destroy the given scan context.
detaileddescription:
@param ctx A pointer to an iio_scan_context structure

<b>NOTE:</b> After that function, the iio_scan_context pointer shall be invalid.  


refid: ga279a930b7b597a06f454a30a0e770f85
name: iio_scan_context_get_info_list
definition: __api ssize_t iio_scan_context_get_info_list
type: __api ssize_t
argsstring: (struct iio_scan_context *ctx, struct iio_context_info ***info)
briefdescription: Enumerate available contexts.
detaileddescription:
@param ctx A pointer to an iio_scan_context structure
@param info A pointer to a 'const struct iio_context_info **' typed variable.
The pointed variable will be initialized on success.
@returns On success, the number of contexts found.
@returns On failure, a negative error number.


refid: gaffebef5ddf1e6083454eb73d9909f602
name: iio_context_info_get_description
definition: __api __pure const char* iio_context_info_get_description
type: __api __pure const char *
argsstring: (const struct iio_context_info *info)
briefdescription: Get a description of a discovered context.
detaileddescription:
@param info A pointer to an iio_context_info structure
@return A pointer to a static NULL-terminated string


refid: gaaa29e5bac86d00a1cef6e2d00b0ea24c
name: iio_library_get_version
definition: __api void iio_library_get_version
type: __api void
argsstring: (unsigned int *major, unsigned int *minor, char git_tag[8])
briefdescription: Get the version of the libiio library.
detaileddescription:
@param major A pointer to an unsigned integer (NULL accepted)
@param minor A pointer to an unsigned integer (NULL accepted)
@param git_tag A pointer to a 8-characters buffer (NULL accepted)  


refid: ga4a117b0ac02e97aeda92e33c063f7cf0
name: iio_strerror
definition: __api void iio_strerror
type: __api void
argsstring: (int err, char *dst, size_t len)
briefdescription: Get a string description of an error code.
detaileddescription:
@param err The error code
@param dst A pointer to the memory area where the NULL-terminated string
corresponding to the error message will be stored
@param len The available length of the memory area, in bytes  


refid: gaee1f1895db399936d29c5dff34eac21e
name: iio_device_attr_read_all
definition: __api int iio_device_attr_read_all
type: __api int
briefdescription: Read the content of all device-specific attributes.
argsstring:
(struct iio_device *dev, int(*cb)(struct iio_device *dev, const char *attr, const char *value, size_t len, void *d), void *data)

detaileddescription:
@param dev A pointer to an iio_device structure
@param cb A pointer to a callback function
@param data A pointer that will be passed to the callback function
@return On success, 0 is returned
@return On error, a negative errno code is returned

<b>NOTE:</b> This function is especially useful when used with the network
backend, as all the device-specific attributes are read in one single
command.  


refid: ga8be1b9fa5383746ff8d76cedf1ff0156
name: iio_buffer_foreach_sample
definition: __api ssize_t iio_buffer_foreach_sample
type: __api ssize_t
briefdescription: Call the supplied callback for each sample found in a buffer.
argsstring:
(struct iio_buffer *buf, ssize_t(*callback)(const struct iio_channel *chn, void *src, size_t bytes, void *d), void *data)

detaileddescription:
@param buf A pointer to an iio_buffer structure
@param callback A pointer to a function to call for each sample found
@param data A user-specified pointer that will be passed to the callback
@return number of bytes processed.

<b>NOTE:</b> The callback receives four arguments:
* A pointer to the iio_channel structure corresponding to the sample,
* A pointer to the sample itself,
* The length of the sample in bytes,
* The user-specified pointer passed to iio_buffer_foreach_sample.  


refid: ga4d8f3a846d5df8ee97c91789014dcb16
name: iio_device_debug_attr_read_all
definition: __api int iio_device_debug_attr_read_all
type: __api int
briefdescription: Read the content of all debug attributes.
argsstring:
(struct iio_device *dev, int(*cb)(struct iio_device *dev, const char *attr, const char *value, size_t len, void *d), void *data)

detaileddescription:
@param dev A pointer to an iio_device structure
@param cb A pointer to a callback function
@param data A pointer that will be passed to the callback function
@return On success, 0 is returned
@return On error, a negative errno code is returned

<b>NOTE:</b> This function is especially useful when used with the network
backend, as all the debug attributes are read in one single command.  


refid: acd751b0b0f65920228bd694cdef8b6e3
name: iiod_client_get_trigger
definition: int iiod_client_get_trigger
type: int
argsstring:
(struct iiod_client *client, void *desc, const struct iio_device *dev, const struct iio_device **trigger)


refid: af05ed169bc37f98cf20d0afd648d16f6
name: iiod_client_set_trigger
definition: int iiod_client_set_trigger
type: int
argsstring:
(struct iiod_client *client, void *desc, const struct iio_device *dev, const struct iio_device *trigger)


refid: a2a1e8caef79ba3880e5bdbf80e0106dd
name: iiod_client_read_attr
definition: ssize_t iiod_client_read_attr
type: ssize_t
argsstring:
(struct iiod_client *client, void *desc, const struct iio_device *dev, const struct iio_channel *chn, const char *attr, char *dest, size_t len, bool is_debug)


refid: a49079367a2b42d100fe7df9663d48f2f
name: iiod_client_write_attr
definition: ssize_t iiod_client_write_attr
type: ssize_t
argsstring:
(struct iiod_client *client, void *desc, const struct iio_device *dev, const struct iio_channel *chn, const char *attr, const char *src, size_t len, bool is_debug)


refid: ada72d87701be8a050c678929e5aa9942
name: iiod_client_open_unlocked
definition: int iiod_client_open_unlocked
type: int
argsstring:
(struct iiod_client *client, void *desc, const struct iio_device *dev, size_t samples_count, bool cyclic)


refid: a92572a42a6621ddf48a44a7425f735b3
name: iiod_client_read_unlocked
definition: ssize_t iiod_client_read_unlocked
type: ssize_t
argsstring:
(struct iiod_client *client, void *desc, const struct iio_device *dev, void *dst, size_t len, uint32_t *mask, size_t words)


refid: a88578ec7af2107a2c539061d52aa8723
name: local_ops
definition: const struct iio_backend_ops local_ops
type: const struct iio_backend_ops
initializer:
= {
	.clone = local_clone,
	.open = local_open,
	.close = local_close,
	.get_fd = local_get_fd,
	.set_blocking_mode = local_set_blocking_mode,
	.read = local_read,
	.write = local_write,
	.set_kernel_buffers_count = local_set_kernel_buffers_count,
	.get_buffer = local_get_buffer,
	.read_device_attr = local_read_dev_attr,
	.write_device_attr = local_write_dev_attr,
	.read_channel_attr = local_read_chn_attr,
	.write_channel_attr = local_write_chn_attr,
	.get_trigger = local_get_trigger,
	.set_trigger = local_set_trigger,
	.shutdown = local_shutdown,
	.set_timeout = local_set_timeout,
	.cancel = local_cancel,
}


refid: a79d6999a9125d077ac120954917ae609
name: strcut
definition: static void strcut
type: void
argsstring: (char *str, int nb)
detaileddescription:
 Shrinks the first nb characters of a string
e.g. strcut("foobar", 4) replaces the content with "ar".  


refid: ab736aae6b6f03adda3f94edbcb5ac328
name: network_ops
definition: const struct iio_backend_ops network_ops
type: const struct iio_backend_ops
initializer:
= {
	.clone = network_clone,
	.open = network_open,
	.close = network_close,
	.read = network_read,
	.write = network_write,



	.read_device_attr = network_read_dev_attr,
	.write_device_attr = network_write_dev_attr,
	.read_channel_attr = network_read_chn_attr,
	.write_channel_attr = network_write_chn_attr,
	.get_trigger = network_get_trigger,
	.set_trigger = network_set_trigger,
	.shutdown = network_shutdown,
	.get_version = network_get_version,
	.set_timeout = network_set_timeout,
	.set_kernel_buffers_count = network_set_kernel_buffers_count,

	.cancel = network_cancel,
}


refid: abd463ffc7d4e9523ee53d8937390d243
name: __avahi_resolver_cb
definition: static void __avahi_resolver_cb
type: void
argsstring:
(AvahiServiceResolver *resolver, __notused AvahiIfIndex iface, __notused AvahiProtocol proto, __notused AvahiResolverEvent event, __notused const char *name, __notused const char *type, __notused const char *domain, __notused const char *host_name, const AvahiAddress *address, uint16_t port, __notused AvahiStringList *txt, __notused AvahiLookupResultFlags flags, void *d)


refid: a367d5b516fba987da36e14f18f724416
name: __avahi_browser_cb
definition: static void __avahi_browser_cb
type: void
argsstring:
(AvahiServiceBrowser *browser, AvahiIfIndex iface, AvahiProtocol proto, AvahiBrowserEvent event, const char *name, const char *type, const char *domain, __notused AvahiLookupResultFlags flags, void *d)


refid: a20a9e13963ddb25f5056692d26c6fe92
name: serial_ops
definition: const struct iio_backend_ops serial_ops
type: const struct iio_backend_ops
initializer:
= {
	.get_version = serial_get_version,
	.open = serial_open,
	.close = serial_close,
	.read = serial_read,
	.write = serial_write,
	.read_device_attr = serial_read_dev_attr,
	.write_device_attr = serial_write_dev_attr,
	.read_channel_attr = serial_read_chn_attr,
	.write_channel_attr = serial_write_chn_attr,
	.set_kernel_buffers_count = serial_set_kernel_buffers_count,
	.shutdown = serial_shutdown,
	.set_timeout = serial_set_timeout,
}


refid: acde90c4a7393f8a2a67d584627c73a23
name: apply_settings
definition: static int apply_settings
type: int
argsstring:
(struct sp_port *port, unsigned int baud_rate, unsigned int bits, unsigned int stop_bits, enum sp_parity parity, enum sp_flowcontrol flow)


refid: a6ecdceb4f16c4ad9ec795db6c92f55e1
name: serial_create_context
definition: static struct iio_context* serial_create_context
type: struct iio_context *
argsstring:
(const char *port_name, unsigned int baud_rate, unsigned int bits, enum sp_parity parity, enum sp_flowcontrol flow)


refid: a6dac43ee4d797283075c728d4a02b699
name: serial_parse_params
definition: static int serial_parse_params
type: int
argsstring:
(const char *params, unsigned int *baud_rate, unsigned int *bits, enum sp_parity *parity, enum sp_flowcontrol *flow)


refid: acbdf7777a2c0354bb2c068122c0961d7
name: libusb_to_errno_codes
definition: const unsigned int libusb_to_errno_codes[]
type: const unsigned int
argsstring: []
initializer:
= {
	[- LIBUSB_ERROR_INVALID_PARAM]	= EINVAL,
	[- LIBUSB_ERROR_ACCESS]		= EACCES,
	[- LIBUSB_ERROR_NO_DEVICE]	= ENODEV,
	[- LIBUSB_ERROR_NOT_FOUND]	= ENXIO,
	[- LIBUSB_ERROR_BUSY]		= EBUSY,
	[- LIBUSB_ERROR_TIMEOUT]	= ETIMEDOUT,
	[- LIBUSB_ERROR_OVERFLOW]	= EIO,
	[- LIBUSB_ERROR_PIPE]		= EPIPE,
	[- LIBUSB_ERROR_INTERRUPTED]	= EINTR,
	[- LIBUSB_ERROR_NO_MEM]		= ENOMEM,
	[- LIBUSB_ERROR_NOT_SUPPORTED]	= ENOSYS,
}


refid: aec88379f53f3af087bdc2ece4b5d9b17
name: usb_ops
definition: const struct iio_backend_ops usb_ops
type: const struct iio_backend_ops
initializer:
= {
	.get_version = usb_get_version,
	.open = usb_open,
	.close = usb_close,
	.read = usb_read,
	.write = usb_write,
	.read_device_attr = usb_read_dev_attr,
	.read_channel_attr = usb_read_chn_attr,
	.write_device_attr = usb_write_dev_attr,
	.write_channel_attr = usb_write_chn_attr,
	.set_kernel_buffers_count = usb_set_kernel_buffers_count,
	.set_timeout = usb_set_timeout,
	.shutdown = usb_shutdown,

	.cancel = usb_cancel,
}


refid: a0c30791a0997c0cda0803137ab6c19a5
name: iio_usb_match_interface
definition: static int iio_usb_match_interface
type: int
argsstring:
(const struct libusb_config_descriptor *desc, struct libusb_device_handle *hdl, unsigned int interface)


refid: a315c28ba0923f45438df934633175bf0
name: usb_sync_transfer
definition: static int usb_sync_transfer
type: int
argsstring:
(struct iio_context_pdata *pdata, struct iio_usb_io_context *io_ctx, unsigned int ep_type, char *data, size_t len, int *transferred)


refid: a4908766a141e33ff08ee75cd292e4358
name: usb_fill_context_info
definition: static int usb_fill_context_info
type: int
argsstring:
(struct iio_context_info *info, struct libusb_device *dev, struct libusb_device_handle *hdl, unsigned int interface)


