xtos_ bci_ session_ create
Opens an XTOS BCI device with O_RDWR, creates a session, and attempts to cache GET_INFO.
On this page
Declaration
#include <xtos/bci.h>
xtos_bci_session_t *xtos_bci_session_create(const char *device_path);Parameters
| Parameter | Type | Description |
|---|---|---|
| device_path | const char * | Non-NULL NUL-terminated device-node path, for example /dev/xtos0. |
Return value
Returns a session handle on success or NULL with allocation/open errno on failure. GET_INFO failure does not make an already opened session fail creation.
Errors
| errno | Condition |
|---|---|
| EINVAL | device_path is NULL. |
| ENOENT/EACCES/EBUSY | The node is missing, permission is denied, or the driver disallows another opener. |
| system errno | Preserves errno from calloc or open failure. |
Notes
- The session owns the fd, device path, and mmap state; callers may borrow fd/mapping through the API but must not close/munmap them.
- If GET_INFO fails, info remains calloc-zeroed and later get_info may still return 0; creation does not prove valid device UAPI support.
- Externally serialize every API on one session; the SDK has no internal lock. Calls may block or allocate and establish no real-time deadline guarantee.
- Creation preallocates separate staging/published frame_read buffers for at most 292 records each, 65408 bytes per buffer. Any allocation failure closes the fd and frees prior allocations.
Example
Source
This reference describes headers and implementation in OpenXTOS v1.0.2 (c24e923717670c4724cdaf24c7c105caee8dc2fb).