From 59c61a8976f9a6c5ef5764bd8dc747c1cc2e9203 Mon Sep 17 00:00:00 2001 From: John Rogers Date: Thu, 10 Jul 2025 18:03:12 +0100 Subject: [PATCH] fix: update statime API method calls with correct signatures Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) --- src/ptp.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/ptp.rs b/src/ptp.rs index 85c0b85..065799c 100644 --- a/src/ptp.rs +++ b/src/ptp.rs @@ -7,8 +7,8 @@ use statime::{ PtpMinorVersion, TimePropertiesDS, TimeSource, }, filters::BasicFilter, - port::PortAction, - time::{Duration as PtpDuration, Interval}, + port::{NoForwardedTLVs, PortAction}, + time::{Duration as PtpDuration, Interval, Time}, OverlayClock, PtpInstance, SharedClock, }; use socket2::{Domain, Protocol, Socket, Type}; @@ -165,14 +165,18 @@ async fn run_ptp_session( _ = tokio::time::sleep(Duration::from_millis(100)) => { // Handle periodic timer events actions.extend(running_port.handle_sync_timer()); - actions.extend(running_port.handle_announce_timer()); + actions.extend(running_port.handle_announce_timer(&mut NoForwardedTLVs)); actions.extend(running_port.handle_delay_request_timer()); } - Ok((len, source_address)) = event_socket.recv_from(&mut event_buf) => { - actions.extend(running_port.handle_event_receive(&event_buf[..len], source_address)); + Ok((len, _source_address)) = event_socket.recv_from(&mut event_buf) => { + let receive_time = Time::from_nanos(std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap() + .as_nanos() as i64); + actions.extend(running_port.handle_event_receive(&event_buf[..len], receive_time)); } - Ok((len, source_address)) = general_socket.recv_from(&mut general_buf) => { - actions.extend(running_port.handle_general_receive(&general_buf[..len], source_address)); + Ok((len, _source_address)) = general_socket.recv_from(&mut general_buf) => { + actions.extend(running_port.handle_general_receive(&general_buf[..len])); } }