Implementation of USHER's token-bound, interval-based clock alignment. More...

Go to the source code of this file.
Functions | |
| static bool | same_token (union usher_clock_request_union first, union usher_clock_request_union second) |
| Compare opaque wire tokens without depending on host structure padding. | |
| bool | clock_alignment_request (struct clock_alignment *clock, union usher_clock_request_union token, uint64_t sent_us) |
| Register a newly transmitted clock probe. | |
| bool | clock_alignment_reply (struct clock_alignment *clock, const uint8_t *payload, size_t length, uint64_t received_us) |
| Validate a flight-controller clock reply and establish a mapping anchor. | |
| bool | clock_alignment_map (const struct clock_alignment *clock, union usher_clock_request_union token, uint32_t fc_us, uint64_t now_us, struct clock_interval *interval) |
| Project a controller timestamp into a conservative USHER time interval. | |
Detailed Description
Implementation of USHER's token-bound, interval-based clock alignment.
This intentionally avoids synchronizing clocks globally. It validates a small request/reply exchange, then maps only poses that carry the matching token. Integer interval arithmetic makes the drift assumptions explicit and handles normal uint32_t flight-controller timer wrap by subtraction.
Definition in file clock_alignment.c.
Function Documentation
◆ clock_alignment_map()
| bool clock_alignment_map | ( | const struct clock_alignment * | clock, |
| union usher_clock_request_union | token, | ||
| uint32_t | fc_us, | ||
| uint64_t | now_us, | ||
| struct clock_interval * | interval ) |
Project a controller timestamp into a conservative USHER time interval.
- Parameters
-
clock Accepted alignment state. token Token proving the pose belongs to this probe epoch. fc_us 32-bit controller microsecond timestamp. now_us Current USHER monotonic time, used to reject stale/future projections. interval Receives inclusive projected bounds.
- Returns
- True when
intervalcontains a plausible mapping.
- Warning
- The result is an interval, not a claimed exact timestamp.
Definition at line 75 of file clock_alignment.c.
◆ clock_alignment_reply()
| bool clock_alignment_reply | ( | struct clock_alignment * | clock, |
| const uint8_t * | payload, | ||
| size_t | length, | ||
| uint64_t | received_us ) |
Validate a flight-controller clock reply and establish a mapping anchor.
- Parameters
-
clock Mutable synchronization state. payload Exact reply payload bytes. length Payload length. received_us USHER monotonic receive timestamp.
- Returns
- True only for a matching, bounded-latency reply.
Rather than guessing a one-way delay, this stores an interval spanning the possible controller transmit instant, including bounded service time and clock drift.
Definition at line 50 of file clock_alignment.c.
◆ clock_alignment_request()
| bool clock_alignment_request | ( | struct clock_alignment * | clock, |
| union usher_clock_request_union | token, | ||
| uint64_t | sent_us ) |
Register a newly transmitted clock probe.
- Parameters
-
clock Mutable synchronization state. token Nonzero random token carried on the wire. sent_us USHER monotonic timestamp at transmission.
- Returns
- True if the probe is accepted as pending.
Tokens must not repeat the pending or last accepted probe; this prevents a delayed reply from being mistaken for fresh timing evidence.
Definition at line 39 of file clock_alignment.c.
◆ same_token()
|
static |
Compare opaque wire tokens without depending on host structure padding.
Definition at line 34 of file clock_alignment.c.