Network backend: Fix call of command READBUF

The prototype of the READBUF command has been modified in the
IIO Daemon, so it needs to be modified there too.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
iio_readdev: Disable XML backend

It makes no sense to have a way to use the XML backend there,
as this backend does not provide the low-level functions needed
to read a stream from a device.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
iio_readdev: Accept a list of channels to enable

The iio_readdev test program can now be passed a list of channels
to enable. If none is passed, then all channels are enabled.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
iio_readdev: Make the trigger an optional argument

And also make sure we output the bytes that have been read and
not the whole buffer.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
IIOD: Fixed calculation of mask when re-opening device

The new mask is also printed now when compiled with debug activated.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
IIOD: Return code 0 when no more bytes can be read

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Added private function iio_device_process_samples

This function can be used to perform various operations on samples:
format conversion, demultiplexing, etc.

It accepts a pointer to a function as parameter, that will be called
for each sample of the buffer.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Network backend: Demux the stream received to keep only wanted channels

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>