Loading...
Searching...
No Matches
pose_log.c
Go to the documentation of this file.
43_Static_assert(sizeof(union usher_pose_sample_union) == USHER_POSE_SAMPLE_MSG_SIZE, "Pose wire size");
86/* The header defines schema 2's stable column order; preserve it for offline evidence readers. */
88 "schema,mora_boot_id,receive_monotonic_us,accepted_index,queue_dropped,fc_sequence,fc_sample_begin_us,fc_sample_end_us,"
92 "clock_token_low,clock_token_high,clock_mapped,sample_earliest_monotonic_us,sample_latest_monotonic_us,"
93 "probe_sent_monotonic_us,probe_received_monotonic_us,probe_receive_fc_us,probe_transmit_fc_us,clock_drift_bound_ppm\n";
140 if (bytes_written > POSE_LOG_MAX_BYTES || (size_t)length > POSE_LOG_MAX_BYTES - bytes_written) return EFBIG;
185 for (size_t index = 0; index < batch_count && error == 0; ++index) error = write_record(&batch[index]);
230 if (gmtime_r(&now, &utc) == NULL || strftime(stamp, sizeof(stamp), "%Y%m%dT%H%M%SZ", &utc) == 0) {
307int pose_log_record_clocked(const uint8_t *payload, size_t length, uint64_t receive_monotonic_us,
323 && (uint32_t)(sample.data.sample_end_us - sample.data.sample_begin_us) <= POSE_LOG_MAX_SAMPLE_WINDOW_US
Read Linux's boot-unique identifier for pose-log session provenance.
static void usher_boot_id(char result[37])
Fill a 36-character boot UUID or the stable fallback "unknown".
Definition boot_id.h:36
static int record(const union dc_shot_union *shot)
Retrieve a point and admit a new observation only when its credit is free.
Definition dipla_camera_backend.c:206
Small path and writable-directory helpers shared by USHER backends.
static const char * usher_resolve_path(const char *path, char *buffer, size_t buffer_size)
Expand a leading home-directory shorthand without allocating memory.
Definition path_utils.h:74
static int usher_ensure_directory(const char *path)
Create missing directory components and verify the final directory is writable.
Definition path_utils.h:97
int pose_log_record(const uint8_t *payload, size_t length, uint64_t receive_monotonic_us)
Validate and enqueue a raw pose payload without clock mapping evidence.
Definition pose_log.c:296
int pose_log_record_clocked(const uint8_t *payload, size_t length, uint64_t receive_monotonic_us, const struct pose_clock_evidence *evidence)
Validate and enqueue a pose payload with optional mapped timing provenance.
Definition pose_log.c:307
int pose_log_start(const char *directory)
Start a durable asynchronous CSV session, or disable logging when directory is empty.
Definition pose_log.c:197
int pose_log_stop(void)
Flush queued records, join the writer, and close the CSV file.
Definition pose_log.c:375
struct pose_log_stats pose_log_status(void)
Return a synchronized snapshot of logging health and loss counters.
Definition pose_log.c:365
Non-blocking pose-evidence CSV logging API.
Optional token-bound evidence mapping a controller pose interval to MORA time.
Definition pose_log.h:29
Snapshot counters for accepted, flushed, dropped, and rejected pose records.
Definition pose_log.h:40
Definition pose_log.c:64
Definition usher_protocol.h:51
struct dc_shot_union::@351207206061007345226276304225222200157171312155 data
struct usher_clock_request_union::@124322121054031044024143305010352315355331137256 data
Definition usher_protocol.h:261
int32_t velocity_north_bfp
Definition usher_protocol.h:267
struct usher_pose_sample_union::@042015206147200076364072004013147106310343341221 data
Shared FC/MORA byte-stream UART framing, messages and payload layouts.
static bool usher_pose_flags_valid(uint32_t flags)
Check the structural consistency of pose-sample GPS flags.
Definition usher_protocol.h:250