xtos_ bci_ set_ sampling_ rate
Requests an integer sampling rate through ioctl and updates the session cache after success.
On this page
Declaration
#include <xtos/bci.h>
int xtos_bci_set_sampling_rate(xtos_bci_session_t *session, uint32_t rate);Parameters
| Parameter | Type | Description |
|---|---|---|
| session | xtos_bci_session_t * | Non-NULL session handle. |
| rate | uint32_t | Sampling rate in Hz; the library does not check the device support list. |
Return value
Returns 0 and updates info.sampling_rate after ioctl success; returns -1 without updating the cache on failure.
Errors
| errno | Condition |
|---|---|
| EINVAL | session is NULL or the driver considers rate invalid. |
| ENOTTY/EOPNOTSUPP | The device does not support setting the sampling rate. |
| system errno | Preserves driver or system errno from ioctl failure. |
Notes
- The library does not resize an existing ring buffer or verify that hardware adopted the requested configuration.
- Success updates the user-space cache; do not call concurrently with reads, mmap, or other configuration.
Example
Source
This reference describes headers and implementation at OpenXTOS commit dd313955ad57542bcd2af8827157d1bbd0cf5e83.