Skip to content

Commit

Permalink
Provide EXT_TIME to API
Browse files Browse the repository at this point in the history
  • Loading branch information
ypo committed Nov 5, 2024
1 parent 45dd4a8 commit f515b3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/receiver/fdtreceiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub struct FdtReceiver {
fdt_instance: Option<FdtInstance>,
sender_current_time_offset: Option<std::time::Duration>,
sender_current_time_late: bool,
pub ext_time: Option<std::time::SystemTime>,
pub reception_start_time: SystemTime,
enable_expired_check: bool,
meta: Option<ObjectMetadata>,
Expand Down Expand Up @@ -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())
Expand Down
3 changes: 1 addition & 2 deletions src/receiver/receiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -393,7 +392,7 @@ impl Receiver {
meta,
transfer_duration,
now,
ext_time,
fdt_current.ext_time,
);
}
self.fdt_current.push_front(fdt_current);
Expand Down

0 comments on commit f515b3d

Please sign in to comment.