feat: Integrate statime for PTP time sync

Co-authored-by: aider (gemini/gemini-2.5-pro-preview-05-06) <aider@aider.chat>
This commit is contained in:
Chaos Rogers 2025-07-10 16:33:47 +01:00
parent 41ae37b6b7
commit 78ea1aefed
7 changed files with 200 additions and 40 deletions

View file

@ -45,6 +45,9 @@ pub struct LtcState {
pub offset_history: VecDeque<i64>,
pub last_match_status: String,
pub last_match_check: i64,
// PTP state
pub ptp_offset: Option<f64>,
pub ptp_state: String,
}
impl LtcState {
@ -56,6 +59,8 @@ impl LtcState {
offset_history: VecDeque::with_capacity(20),
last_match_status: "UNKNOWN".into(),
last_match_check: 0,
ptp_offset: None,
ptp_state: "Initializing".into(),
}
}