xtos_ bci_ get_ info
Copies the device information cached at session creation into caller storage.
On this page
Declaration
#include <xtos/bci.h>
int xtos_bci_get_info(xtos_bci_session_t *session,
struct xtos_bci_device_info *info);Parameters
| Parameter | Type | Description |
|---|---|---|
| session | xtos_bci_session_t * | Non-NULL session handle. |
| info | struct xtos_bci_device_info * | Non-NULL caller-provided output structure. |
Output fields
| Field | Type | Meaning |
|---|---|---|
| name | char[32] | Device-name character array; NUL termination is not guaranteed, so bound display length. |
| dev_id | uint32_t | Device identifier, with no unit. |
| num_channels | uint32_t | Number of device channels, counted in channels. |
| sampling_rate | uint32_t | Current sampling rate, in Hz. |
| resolution_bits | uint32_t | ADC resolution, in bits. |
| input_range_mv | uint32_t | Input range, in mV; the public UAPI uses an integer. |
| interface | uint32_t | Device 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
| errno | Condition |
|---|---|
| EINVAL | session 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.