modules/woz_uwb/src/facade/flight_recorder.h
openaliro/openaliro
Module

flight_recorder.h

modules/woz_uwb/src/facade/flight_recorder.h13 documented symbols

Overview

@file flight_recorder.h Capture and replay UWB frames and session configuration from a walk-up to a host for analysis and replay. Records endpoint identity, status registers, frame data, and timing metadata into a fixed-size ring buffer; provides reader and writer interfaces for host tools.

used by ccc_shim_rx.c flight_recorder.c woz_uwb_facade.c aliro_shell.c

API

Cstruct fr_meta

modules/woz_uwb/src/facade/flight_recorder.h:93

Metadata header for a flight recorder stream: protocol version, port identifier (target), and the firmware commit SHA1.

Cstruct fr_config

modules/woz_uwb/src/facade/flight_recorder.h:104

Captured Aliro session configuration snapshot: channel, timing parameters, STS index, URSK, and responder credentials. Populated once at the start of each walk-up and replayed to reconstruct session state during offline analysis.

Cstruct fr_ev

modules/woz_uwb/src/facade/flight_recorder.h:123

Single UWB event captured during a walk-up: endpoint identity, status register, frame length, Ipatov and TX timestamps, STS quality metrics, and up to FR_FRAME_MAX bytes of the received frame.

Cstruct fr_end

modules/woz_uwb/src/facade/flight_recorder.h:141

Trailer record marking the end of a flight recorder session: the count of captured events and a truncation flag (1 if the ring filled and later events were dropped).

Cstruct fr_record

modules/woz_uwb/src/facade/flight_recorder.h:150

One record in a flight recorder stream: a discriminated union holding either a metadata header, session configuration snapshot, a captured event, or the end-of-session trailer.

Cfr_writer_t

modules/woz_uwb/src/facade/flight_recorder.h:165

─ Writer: append records to a fixed caller-owned buffer ───────────────── Every fr_write_* returns 0 on success or -1 if the record did not fit; on the first non-fit the writer latches overflow and all further writes are no-ops, so the buffer always holds a valid record prefix (never a half-written tail).

Cfr_reader_t

modules/woz_uwb/src/facade/flight_recorder.h:183

─ Reader: iterate a trace buffer ──────────────────────────────────────── fr_read_next fills *out and returns the record type (>0), 0 at clean end, or -1 on a malformed/short/oversized/version-mismatched stream. The first record of a well-formed trace is FR_REC_META and must carry FR_VERSION.

Fstatic inline void fr_set_enabled(bool on)

modules/woz_uwb/src/facade/flight_recorder.h:219

Stub callback that enables or disables flight recording. No-op when the flight recorder is disabled.

Fstatic inline bool fr_enabled(void)

modules/woz_uwb/src/facade/flight_recorder.h:227

Returns true if the flight recorder is enabled and capturing events; false otherwise. Stub when disabled.

Fstatic inline void fr_capture_config(const struct woz_uwb_aliro_cfg *cfg)

modules/woz_uwb/src/facade/flight_recorder.h:235

Stub callback invoked when the flight recorder captures the Aliro session configuration. No-op when the flight recorder is disabled.

Fstatic inline void fr_capture_ev(uint8_t ep, uint32_t status, uint16_t datalength)

modules/woz_uwb/src/facade/flight_recorder.h:243

Stub callback invoked when the flight recorder captures a UWB event (endpoint fire, status, or frame length). No-op when the flight recorder is disabled.

Fstatic inline void fr_dump(void)

modules/woz_uwb/src/facade/flight_recorder.h:253

Stub callback that dumps the flight recorder ring buffer to the host interface. No-op when the flight recorder is disabled.

Fstatic inline void fr_clear(void)

modules/woz_uwb/src/facade/flight_recorder.h:260

Stub callback that clears the flight recorder ring buffer. No-op when the flight recorder is disabled.

##define FR_MAGIC 0x31435246u

modules/woz_uwb/src/facade/flight_recorder.h:52

##define FR_VERSION 1u

modules/woz_uwb/src/facade/flight_recorder.h:53

##define FR_FRAME_MAX 128u

modules/woz_uwb/src/facade/flight_recorder.h:57

##define FR_URSK_LEN 32u

modules/woz_uwb/src/facade/flight_recorder.h:58

##define FR_RC_MAX 64u

modules/woz_uwb/src/facade/flight_recorder.h:59

##define FR_SHA_MAX 16u

modules/woz_uwb/src/facade/flight_recorder.h:60

Cenum fr_port

modules/woz_uwb/src/facade/flight_recorder.h:66

Cenum fr_rec_type

modules/woz_uwb/src/facade/flight_recorder.h:73

Cenum fr_ep

modules/woz_uwb/src/facade/flight_recorder.h:81

Fvoid fr_writer_init(fr_writer_t *w, uint8_t *buf, size_t cap)

modules/woz_uwb/src/facade/flight_recorder.h:172

Fint fr_write_meta(fr_writer_t *w, uint16_t port, const char *sha)

modules/woz_uwb/src/facade/flight_recorder.h:173

Fint fr_write_config(fr_writer_t *w, const struct fr_config *cfg)

modules/woz_uwb/src/facade/flight_recorder.h:174

Fint fr_write_ev(fr_writer_t *w, const struct fr_ev *ev)

modules/woz_uwb/src/facade/flight_recorder.h:175

Fint fr_write_end(fr_writer_t *w, uint32_t n_events, bool truncated)

modules/woz_uwb/src/facade/flight_recorder.h:176

Fvoid fr_reader_init(fr_reader_t *r, const uint8_t *buf, size_t len)

modules/woz_uwb/src/facade/flight_recorder.h:190

Fint fr_read_next(fr_reader_t *r, struct fr_record *out)

modules/woz_uwb/src/facade/flight_recorder.h:191

Fsize_t fr_finalize(const uint8_t **buf)

modules/woz_uwb/src/facade/flight_recorder.h:208

Fvoid fr_set_dump_sink(void (*sink)(const char *line))

modules/woz_uwb/src/facade/flight_recorder.h:211