Constructs a new `Phc` IO source instance using the given parameters. This implementation performs autoconfiguration to determine the PHC device that should be used for obtaining reference clock timestamps and the corresponding clock error bound for those timestamps.
(
event_sender: async_ring_buffer::Sender<event::Phc>,
ctrl_receiver: mpsc::Receiver<ControlRequest>,
clock_disruption_receiver: watch::Receiver<ClockDisruptionEvent>,
)
| 182 | /// This implementation performs autoconfiguration to determine |
| 183 | /// the PHC device that should be used for obtaining reference clock |
| 184 | /// timestamps and the corresponding clock error bound for those timestamps. |
| 185 | pub async fn construct( |
| 186 | event_sender: async_ring_buffer::Sender<event::Phc>, |
| 187 | ctrl_receiver: mpsc::Receiver<ControlRequest>, |
| 188 | clock_disruption_receiver: watch::Receiver<ClockDisruptionEvent>, |
| 189 | ) -> Result<Self, PhcError> { |
| 190 | let (phc_reader, phc_clock_error_bound_reader, device_path) = |
| 191 | Self::autoconfigure_phc_readers().await?; |
| 192 | let mut phc_interval = interval(PHC_SOURCE_INTERVAL_DURATION); |
| 193 | phc_interval.set_missed_tick_behavior(MissedTickBehavior::Delay); |
| 194 | |
| 195 | Ok(Phc { |
| 196 | event_sender, |
| 197 | ctrl_receiver, |
| 198 | clock_disruption_receiver, |
| 199 | interval: phc_interval, |
| 200 | reader: phc_reader, |
| 201 | clock_error_bound_reader: phc_clock_error_bound_reader, |
| 202 | device_path, |
| 203 | }) |
| 204 | } |
| 205 | |
| 206 | /// Getter for `device_path` |
nothing calls this directly
no outgoing calls
no test coverage detected