xtos_ bci_ read_ samples
Performs one device read directly into a float buffer and returns the byte count divided by sizeof(float).
On this page
Declaration
#include <xtos/bci.h>
ssize_t xtos_bci_read_samples(xtos_bci_session_t *session,
float *buffer,
size_t num_samples);Parameters
| Parameter | Type | Description |
|---|---|---|
| session | xtos_bci_session_t * | Non-NULL session handle. |
| buffer | float * | Non-NULL caller-owned buffer holding at least num_samples floats. |
| num_samples | size_t | Requested scalar float count, greater than zero; it is not automatically a frame count. |
Return value
Returns a nonnegative count and permits short reads; returns -1 on failure.
Errors
| errno | Condition |
|---|---|
| EINVAL | session or buffer is NULL, or num_samples is zero. |
| EAGAIN/EINTR | A nonblocking setup or signal interruption can make the underlying read return these errno values. |
| system errno | Other read failures preserve the underlying errno. |
Notes
- The public implementation does not check multiplication overflow, frame alignment, or timestamps; read may block by default and callers must handle short reads.
- The public driver writes int32 nanovolt bytes while this implementation reads them directly into float* without int32→float or nV→µV conversion; do not interpret it as floating-point EEG.
- The caller allocates and frees buffer; the function returns no device timestamp, sequence, quality flag, or reliable frame boundary.
Example
Source
This reference describes headers and implementation at OpenXTOS commit dd313955ad57542bcd2af8827157d1bbd0cf5e83.