18#define CHERRY_CCC_HOP_MODE_KEY_SIZE 4
58 CHERRY_CCC_EVENT_TYPE_SESSION_STATUS,
59 CHERRY_CCC_EVENT_TYPE_SESSION_ERROR,
60 CHERRY_CCC_EVENT_TYPE_SESSION_CONTROLLER_REPORT,
61 CHERRY_CCC_EVENT_TYPE_SESSION_CONTROLEE_REPORT,
62 CHERRY_CCC_EVENT_TYPE_SESSION_DIAGNOSTIC_REPORT,
67 CHERRY_CCC_SESSION_STATE_INIT,
68 CHERRY_CCC_SESSION_STATE_DEINIT,
69 CHERRY_CCC_SESSION_STATE_ACTIVE,
70 CHERRY_CCC_SESSION_STATE_IDLE,
75 CHERRY_CCC_STATE_CHANGE_REASON_MGMT_CMD,
76 CHERRY_CCC_STATE_CHANGE_REASON_UNKNOWN,
77 CHERRY_CCC_STATE_CHANGE_REASON_FORCE_STOPPED,
100struct cherry_ccc_controller_session_report;
105struct cherry_ccc_controlee_session_report;
148 CHERRY_CCC_HOPPING_MODE_DISABLE = 0,
149 CHERRY_CCC_HOPPING_MODE_ENABLED = 1,
150 CHERRY_CCC_HOPPING_MODE_CONTINUOUS_AES = 0xA0,
151 CHERRY_CCC_HOPPING_MODE_CONTINUOUS_DEFAULT = 0xA1,
152 CHERRY_CCC_HOPPING_MODE_ADAPTATIVE_AES = 0xA2,
153 CHERRY_CCC_HOPPING_MODE_ADAPTATIVE_DEFAULT = 0xA3,
161 uint16_t uwb_config_id;
162 uint8_t pulse_shape_combo;
164 uint8_t sync_code_index;
165 uint32_t ranging_duration_ms;
167 uint16_t slot_duration;
169 uint8_t hopping_config_bitmask;
173 uint64_t uwb_time_us;
244 uint8_t tx_antenna_set,
245 uint8_t rx_antenna_set)
253 const uint8_t *ursk);
257 uint16_t selected_protocol_version);
261 uint8_t tx_antenna_set,
262 uint8_t rx_antenna_set);
270 uint64_t initiation_time_us);
— Cherry core (context + device-capabilities) interface.
cherry_err
Status codes returned across the Cherry / CCC seam.
Definition cherry.h:21
cherry_ccc_state_change_reason
Why a session changed state.
Definition cherry_ccc.h:74
enum 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).
Definition cherry_ccc_shim.c:373
static void * cherry_ccc_session_get_user_data(struct cherry_ccc_session *session)
Fetch the CCC session's user_data via its base session.
Definition cherry_ccc.h:192
static enum cherry_err cherry_ccc_session_start(struct cherry_ccc_session *session)
Start a CCC session (delegates to the base).
Definition cherry_ccc.h:219
static enum cherry_err cherry_ccc_session_stop(struct cherry_ccc_session *session)
Stop a CCC session (delegates to the base).
Definition cherry_ccc.h:230
void(* cherry_ccc_cb_t)(struct cherry_ccc_event *event, void *user_data)
CCC notification callback type.
Definition cherry_ccc.h:144
enum cherry_err cherry_ccc_session_set_sts_index(struct cherry_ccc_session *session, uint32_t sts_index)
Set the starting STS index (resume path).
Definition cherry_ccc_shim.c:357
cherry_ccc_event_type
CCC session event kinds.
Definition cherry_ccc.h:57
enum 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.
Definition cherry_ccc_shim.c:344
static void cherry_ccc_session_destroy(struct cherry_ccc_session *session)
Destroy a CCC session (delegates to the base).
Definition cherry_ccc.h:208
static 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 (delegates to the base).
Definition cherry_ccc.h:243
void cherry_ccc_event_free(struct cherry_ccc_event *event)
Release a CCC event and any heap payload it owns.
Definition cherry_ccc_shim.c:434
#define CHERRY_CCC_HOP_MODE_KEY_SIZE
Length in bytes of the hopping-sequence key carried in M4.
Definition cherry_ccc.h:18
cherry_ccc_hopping_mode
Selected hopping mode.
Definition cherry_ccc.h:147
struct 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).
Definition cherry_ccc_shim.c:158
enum 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).
Definition cherry_ccc_shim.c:328
enum 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.
Definition cherry_ccc_shim.c:391
struct 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).
Definition cherry_ccc_shim.c:185
static enum cherry_err cherry_ccc_session_set_diagnostics(struct cherry_ccc_session *session, struct cherry_common_diag_cfg config)
Enable/disable diagnostics for a CCC session (delegates to the base).
Definition cherry_ccc.h:277
cherry_ccc_session_state
Lifecycle state of a CCC session.
Definition cherry_ccc.h:66
— diagnostics config struct and report forward decl.
— generic base-session interface.
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.
Definition cherry_ccc_shim.c:408
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).
Definition cherry_ccc_shim.c:420
void cherry_session_destroy(struct cherry_session *session)
Stop if needed, tear down, and release the session.
Definition cherry_ccc_shim.c:204
void * cherry_session_get_user_data(struct cherry_session *session)
Return the opaque client pointer stored at session creation.
Definition cherry_ccc_shim.c:195
enum cherry_err cherry_session_start(struct cherry_session *session)
Request the session to start ranging.
Definition cherry_ccc_shim.c:227
enum cherry_err cherry_session_stop(struct cherry_session *session)
Request the session to stop ranging.
Definition cherry_ccc_shim.c:308
Negotiated Aliro ranging params (filled in-place across M1-M4).
Definition cherry_ccc.h:159
Device CCC/Aliro capability set advertised to the peer.
Definition cherry_ccc.h:26
uint8_t hopping_config_bitmask
Supported hopping modes/sequences bitmask.
Definition cherry_ccc.h:32
uint8_t channel_bitmask
Supported channels: b0 => ch5, b1 => ch9.
Definition cherry_ccc.h:34
uint8_t slot_bitmask
Supported slot durations, one bit per NChap-per-slot value.
Definition cherry_ccc.h:28
bool qorvo_vendor_feature_1_supported
Whether the optional vendor feature 1 is supported.
Definition cherry_ccc.h:53
struct cherry_ccc_capabilities::@1 protocol_versions
Supported protocol versions (1.0 encoded 0x0100).
struct cherry_ccc_capabilities::@2 uwb_configs
Supported UWB configuration identifiers.
uint8_t minimum_ran_multiplier
Smallest RAN multiplier the device accepts.
Definition cherry_ccc.h:51
uint32_t sync_code_index_bitmask
Usable SYNC code indices, bit i => code (i+1).
Definition cherry_ccc.h:30
struct cherry_ccc_capabilities::@3 pulse_shape_combos
Supported pulse-shape combinations.
CCC notification delivered to the adapter.
Definition cherry_ccc.h:110
struct cherry_ccc_session * session
Opaque CCC session the event pertains to, defined by the shim.
Definition cherry_ccc.h:115
struct cherry_common_diag_report * diagnostics
Pointer to the diagnostic report snapshot (ranging samples, signal metrics) for this CCC event.
Definition cherry_ccc.h:139
struct cherry_ccc_session_event_session_status * status
Payload pointer for a SESSION_STATUS event.
Definition cherry_ccc.h:120
struct cherry_ccc_controlee_session_report * controlee_report
Pointer to the controlee session report payload, carrying a distance and timestamp snapshot.
Definition cherry_ccc.h:134
struct cherry_ccc_session_event_error * error
Payload pointer for a SESSION_ERROR event.
Definition cherry_ccc.h:124
struct cherry_ccc_controller_session_report * controller_report
Pointer to the controller-side session report payload; report payloads cross the seam only by pointer...
Definition cherry_ccc.h:129
Payload of a SESSION_ERROR event, giving the error status that triggered it.
Definition cherry_ccc.h:92
Payload of a SESSION_STATUS event, giving the new session state and the reason for the change.
Definition cherry_ccc.h:84
CCC ranging session bound to FiRa MAC.
Definition cherry_ccc_shim.c:50
struct cherry_ccc_aliro_session_config * config
Borrowed pointer to the adapter's negotiated params, valid until destroy.
Definition cherry_ccc_shim.c:53
Per-session diagnostics selection flags and CIR window parameters, passed by value.
Definition cherry_common.h:15
Base session object; first member of cherry_ccc_session for up-casting.
Definition cherry_ccc_shim.c:37
Opaque Cherry context holder.
Definition cherry_ccc_shim.c:27