EGD_ACQ_SETUP(3) | EEGDEV library manual | EGD_ACQ_SETUP(3) |
egd_acq_setup - specify which and how channel data should be obtained
#include <eegdev.h>
int egd_acq_setup(struct eegdev* dev,
unsigned int narr, const size_t *strides,
unsigned int ngrp, const struct grpconf
*grp);
egd_acq_setup() configures the way data is provided by the device referenced by dev for the next calls to egd_get_data(3).
The narr argument specifies the number of buffers that will be supplied in the argument list of egd_get_data(3). strides should points to an array of narr values specifying respectively for each buffers its stride, i.e. the size in bytes between the data of two successive samples in this buffer.
The channels data that must be returns in those buffers are defined by ngrp groups of consecutive channels. The groups definition are passed by grp which points to an array of ngrp structures, defined as follows:
struct grpconf {
unsigned int sensortype; /* type of channel */
unsigned int index; /* index of the first channel */
unsigned int nch; /* number of channels */
unsigned int iarray; /* index of the array */
unsigned int arr_offset; /* offset in the array */
unsigned int datatype; /* type in the array */ };
The different fields in the structure defines the properties of the group:
The function returns 0 in case of succes. Otherwise, -1 is returned and errno is set accordingly.
egd_acq_setup() will fail if:
egd_acq_setup() is thread-safe.
See egd_get_data(3) for a example
2010 | EPFL |