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

xtos_bci_get_stats

Reads device statistics through ioctl and copies them into caller storage.

On this page

Declaration

c
#include <xtos/bci.h>

int xtos_bci_get_stats(xtos_bci_session_t *session,
                      struct xtos_bci_statistics *stats);

Parameters

ParameterTypeDescription
sessionxtos_bci_session_t *Non-NULL session handle.
statsstruct xtos_bci_statistics *Non-NULL caller-provided output structure.

Output fields

FieldTypeMeaning
samples_readuint64_tDevice-reported samples read; the public Cyton path counts channel values written to the buffer, not frames consumed by the application.
samples_droppeduint64_tDevice-reported dropped samples; exact counting semantics are driver-defined.
errorsuint64_tDevice-reported error count.
overrunsuint64_tRing-buffer overrun count.

Return value

Returns 0 and writes samples_read, samples_dropped, errors, and overruns on success; returns -1 on failure.

Errors

errnoCondition
EINVALsession or stats is NULL.
ENOTTY/EOPNOTSUPPThe device does not support the statistics ioctl.
system errnoPreserves 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.