diff --git a/src/receiver/fdtreceiver.rs b/src/receiver/fdtreceiver.rs index 53234d0..be2c324 100644 --- a/src/receiver/fdtreceiver.rs +++ b/src/receiver/fdtreceiver.rs @@ -21,6 +21,7 @@ pub struct FdtReceiver { fdt_instance: Option, sender_current_time_offset: Option, sender_current_time_late: bool, + pub ext_time: Option, pub reception_start_time: SystemTime, enable_expired_check: bool, meta: Option, @@ -96,11 +97,13 @@ impl FdtReceiver { reception_start_time: now, enable_expired_check, meta: None, + ext_time: None, } } pub fn push(&mut self, pkt: &alc::AlcPkt, now: std::time::SystemTime) { if let Ok(Some(res)) = alc::get_sender_current_time(pkt) { + self.ext_time = Some(now); if res < now { self.sender_current_time_late = true; self.sender_current_time_offset = Some(now.duration_since(res).unwrap()) diff --git a/src/receiver/receiver.rs b/src/receiver/receiver.rs index 814ff52..a183a43 100644 --- a/src/receiver/receiver.rs +++ b/src/receiver/receiver.rs @@ -384,7 +384,6 @@ impl Receiver { .duration_since(fdt_current.reception_start_time) .unwrap_or(std::time::Duration::new(0, 0)); - let ext_time = alc::get_sender_current_time(alc_pkt).unwrap_or(None); self.writer.fdt_received( &self.endpoint, &self.tsi, @@ -393,7 +392,7 @@ impl Receiver { meta, transfer_duration, now, - ext_time, + fdt_current.ext_time, ); } self.fdt_current.push_front(fdt_current);