xtos_ bci_ get_ stats
Reads device statistics through ioctl and copies them into caller storage.
On this page
Declaration
#include <xtos/bci.h>
int xtos_bci_get_stats(xtos_bci_session_t *session,
struct xtos_bci_statistics *stats);Parameters
| Parameter | Type | Description |
|---|---|---|
| session | xtos_bci_session_t * | Non-NULL session handle. |
| stats | struct xtos_bci_statistics * | Non-NULL caller-provided output structure. |
Output fields
| Field | Type | Meaning |
|---|---|---|
| samples_read | uint64_t | Device-reported samples read; the public Cyton path counts channel values written to the buffer, not frames consumed by the application. |
| samples_dropped | uint64_t | Device-reported dropped samples; exact counting semantics are driver-defined. |
| errors | uint64_t | Device-reported error count. |
| overruns | uint64_t | Ring-buffer overrun count. |
Return value
Returns 0 and writes samples_read, samples_dropped, errors, and overruns on success; returns -1 on failure.
Errors
| errno | Condition |
|---|---|
| EINVAL | session or stats is NULL. |
| ENOTTY/EOPNOTSUPP | The device does not support the statistics ioctl. |
| system errno | Preserves driver or system errno from ioctl failure. |
Notes
- Statistics are driver-defined; public Cyton samples_read counts channel values written to the buffer, not frames consumed by the application.
- The caller owns stats; no cross-field snapshot consistency is promised while reset or device production runs concurrently.
Example
Source
This reference describes headers and implementation at OpenXTOS commit dd313955ad57542bcd2af8827157d1bbd0cf5e83.