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

xtos_bci_get_info

Copies the device information cached at session creation into caller storage.

On this page

Declaration

c
#include <xtos/bci.h>

int xtos_bci_get_info(xtos_bci_session_t *session,
                      struct xtos_bci_device_info *info);

Parameters

ParameterTypeDescription
sessionxtos_bci_session_t *Non-NULL session handle.
infostruct xtos_bci_device_info *Non-NULL caller-provided output structure.

Output fields

FieldTypeMeaning
namechar[32]Device-name character array; NUL termination is not guaranteed, so bound display length.
dev_iduint32_tDevice identifier, with no unit.
num_channelsuint32_tNumber of device channels, counted in channels.
sampling_rateuint32_tCurrent sampling rate, in Hz.
resolution_bitsuint32_tADC resolution, in bits.
input_range_mvuint32_tInput range, in mV; the public UAPI uses an integer.
interfaceuint32_tDevice interface-type enum value; exact values are defined by the UAPI, with no unit.

Return value

Returns 0 and copies the structure on success; returns -1 on failure. It does not issue another GET_INFO ioctl.

Errors

errnoCondition
EINVALsession or info is NULL.

Notes

  • info.name is a fixed 32-byte array and is not guaranteed NUL-terminated; use a bounded display.
  • The caller owns the output; the cache may be zero-valued after GET_INFO failure during creation.

Example

Source

This reference describes headers and implementation at OpenXTOS commit dd313955ad57542bcd2af8827157d1bbd0cf5e83.