cherry_ccc.h
CCC/Aliro-session interface (seam the adapter drives).
Overview
CCC/Aliro-session interface (seam the adapter drives).
depends on cherry.h cherry_common.h cherry_session.h · used by aliro_ranging.c aliro_uwb_adapter.c aliro_uwb_internal.h aliro_uwb_session.c aliro_uwb_adapter.h aliro_uwb_session.h cherry_ccc_shim.c
API
Cstruct cherry_ccc_capabilities
Device CCC/Aliro capability set advertised to the peer.
Cstruct cherry_ccc_session_event_session_status
Payload of a SESSION_STATUS event, giving the new session state and the reason for the change.
Cstruct cherry_ccc_session_event_error
Payload of a SESSION_ERROR event, giving the error status that triggered it.
Cstruct cherry_ccc_event
CCC notification delivered to the adapter.
Cstruct cherry_ccc_aliro_session_config
Negotiated Aliro ranging params (filled in-place across M1-M4).
Fstatic inline void *cherry_ccc_session_get_user_data(struct cherry_ccc_session *session)
Fetch the CCC session's user_data via its base session.
session- CCC session to query.
- returns
- The user_data pointer associated with the session's base.
Fstatic inline void cherry_ccc_session_destroy(struct cherry_ccc_session *session)
Destroy a CCC session, delegating to the base session.
session- CCC session to destroy.
Fstatic inline enum cherry_err cherry_ccc_session_start(struct cherry_ccc_session *session)
Start a CCC session, delegating to the base session.
session- CCC session to start.
- returns
- Error code from cherry_session_start.
Fstatic inline enum cherry_err cherry_ccc_session_stop(struct cherry_ccc_session *session)
Stop a CCC session, delegating to the base session.
session- CCC session to stop.
- returns
- Error code from cherry_session_stop.
Fstatic inline enum cherry_err cherry_ccc_session_set_antennas(struct cherry_ccc_session *session, uint8_t tx_antenna_set, uint8_t rx_antenna_set)
Select round-1 antennas for a CCC session, delegating to the base session.
session- CCC session to configure.
tx_antenna_set- Antenna set to use for transmission.
rx_antenna_set- Antenna set to use for reception.
- returns
- Error code from cherry_session_set_antennas.
Fcherry_ccc_session_set_diagnostics
Opaque CCC session being configured, defined by the shim.
##define CHERRY_CCC_HOP_MODE_KEY_SIZE 4
Length in bytes of the hopping-sequence key carried in M4.
Cenum cherry_ccc_event_type
CCC session event kinds.
Cenum cherry_ccc_session_state
Lifecycle state of a CCC session.
Cenum cherry_ccc_state_change_reason
Why a session changed state.
Ctypedef void (*cherry_ccc_cb_t)(struct cherry_ccc_event *event, void *user_data)
CCC notification callback type.
Cenum cherry_ccc_hopping_mode
Selected hopping mode.
Fstruct cherry_ccc_session * cherry_ccc_session_create_aliro_responder(struct cherry *ctx, cherry_ccc_cb_t callback, void *user_data, struct cherry_ccc_aliro_session_config *config)
Create an Aliro responder session bound to config (NULL on error).
Fstruct cherry_session * cherry_ccc_session_to_base(struct cherry_ccc_session *session)
Return the base session for a CCC session (the base is the first member).
Fvoid cherry_ccc_event_free(struct cherry_ccc_event *event)
Release a CCC event and any heap payload it owns. @param event Event to free.
Fenum cherry_err cherry_ccc_session_set_ursk(struct cherry_ccc_session *session, const uint8_t *ursk)
Provide the 32-byte URSK (host-provided STS root key).
Fenum cherry_err cherry_ccc_session_set_protocol_version(struct cherry_ccc_session *session, uint16_t selected_protocol_version)
Record the selected BLE/UWB protocol version.
Fenum cherry_err cherry_ccc_session_set_round2_antennas(struct cherry_ccc_session *session, uint8_t tx_antenna_set, uint8_t rx_antenna_set)
Select antennas for the Aliro second ranging round.
Fenum cherry_err cherry_ccc_session_set_sts_index(struct cherry_ccc_session *session, uint32_t sts_index)
Set the starting STS index (resume path).
Fenum cherry_err cherry_ccc_session_set_initiation_time(struct cherry_ccc_session *session, uint64_t initiation_time_us)
Set the ranging initiation time on the UWBS time base (resume path).