XTOS / OPEN SOURCE REAL-TIME SYSTEMOPEN SOURCE · VERSION 0.9.0 · BUILD FROM SOURCE
libxtos-bcixtos_bci_set_sampling_rate

xtos_bci_set_sampling_rate

Requests an integer sampling rate through ioctl and updates the session cache after success.

On this page

Declaration

c
#include <xtos/bci.h>

int xtos_bci_set_sampling_rate(xtos_bci_session_t *session, uint32_t rate);

Parameters

ParameterTypeDescription
sessionxtos_bci_session_t *Non-NULL session handle.
rateuint32_tSampling 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

errnoCondition
EINVALsession is NULL or the driver considers rate invalid.
ENOTTY/EOPNOTSUPPThe device does not support setting the sampling rate.
system errnoPreserves 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.