openaliro
Aliro reader: UWB/CCC core and ESP32-S3/C5/C6 port
Loading...
Searching...
No Matches
cherry_session.h File Reference

— generic base-session interface. More...

#include <cherry/cherry.h>
#include <cherry/cherry_common.h>
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for cherry_session.h:

Go to the source code of this file.

Functions

void * cherry_session_get_user_data (struct cherry_session *session)
 Return the opaque client pointer stored at session creation.
 
void cherry_session_destroy (struct cherry_session *session)
 Stop if needed, tear down, and release the session.
 
enum cherry_err cherry_session_start (struct cherry_session *session)
 Request the session to start ranging.
 
enum cherry_err cherry_session_stop (struct cherry_session *session)
 Request the session to stop ranging.
 
enum cherry_err cherry_session_set_antennas (struct cherry_session *session, uint8_t tx_antenna_set, uint8_t rx_antenna_set)
 Select the Tx/Rx antenna sets for the first ranging round.
 
enum cherry_err cherry_session_set_diagnostics (struct cherry_session *session, struct cherry_common_diag_cfg config, bool enable_fallback)
 Enable/disable per-session diagnostics (config passed by value).
 

Detailed Description

— generic base-session interface.

Function Documentation

◆ cherry_session_destroy()

void cherry_session_destroy ( struct cherry_session session)

Stop if needed, tear down, and release the session.

Stop if needed, tear down, and release the session.

Parameters
sessionBase session; null or invalid input is safely ignored.

◆ cherry_session_get_user_data()

void * cherry_session_get_user_data ( struct cherry_session session)

Return the opaque client pointer stored at session creation.

Return the opaque client pointer stored at session creation.

Parameters
sessionBase session.
Returns
User data pointer, or null if session is null.

◆ cherry_session_set_antennas()

enum cherry_err cherry_session_set_antennas ( struct cherry_session session,
uint8_t  tx_antenna_set,
uint8_t  rx_antenna_set 
)

Select the Tx/Rx antenna sets for the first ranging round.

Select the Tx/Rx antenna sets for the first ranging round.

Parameters
sessionBase session.
tx_antenna_setTX antenna set (ignored).
rx_antenna_setRX antenna set (ignored).
Returns
CHERRY_ERR_INVALID_PARAMETER if session is null, otherwise CHERRY_ERR_NONE.

◆ cherry_session_set_diagnostics()

enum cherry_err cherry_session_set_diagnostics ( struct cherry_session session,
struct cherry_common_diag_cfg  config,
bool  controlee_only 
)

Enable/disable per-session diagnostics (config passed by value).

Enable/disable per-session diagnostics (config passed by value).

Returns
CHERRY_ERR_INVALID_PARAMETER if session is null, otherwise CHERRY_ERR_NONE.

◆ cherry_session_start()

enum cherry_err cherry_session_start ( struct cherry_session session)

Request the session to start ranging.

Request the session to start ranging.

Parameters
sessionBase session.
Returns
CHERRY_ERR_INVALID_PARAMETER if session or config is null; CHERRY_ERR_SESSION_CONFIG if URSK is not set; CHERRY_ERR_SESSION_INIT if UWB start fails; otherwise CHERRY_ERR_NONE.

◆ cherry_session_stop()

enum cherry_err cherry_session_stop ( struct cherry_session session)

Request the session to stop ranging.

Request the session to stop ranging.

Parameters
sessionBase session.
Returns
CHERRY_ERR_INVALID_PARAMETER if session is null or invalid, otherwise CHERRY_ERR_NONE.