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.
- session.c provides no concurrency lock; do not concurrently read, configure, or destroy one session.
Example
Source
This reference describes headers and implementation at OpenXTOS commit dd313955ad57542bcd2af8827157d1bbd0cf5e83.