From 28bf20a19c98c7e99a67d7186d539aea28133df0 Mon Sep 17 00:00:00 2001 From: steviez Date: Tue, 11 Feb 2020 09:58:01 -0600 Subject: rfnoc: actions: Fix uninitialized timestamps tx_event_action_info objects were being created with uninitialized timestamp members which led to uhd::tx_streamer::recv_async_msg() returning with invalid timestamps --- host/lib/rfnoc/actions.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'host/lib/rfnoc/actions.cpp') diff --git a/host/lib/rfnoc/actions.cpp b/host/lib/rfnoc/actions.cpp index 4de05b304..ecc1b3f20 100644 --- a/host/lib/rfnoc/actions.cpp +++ b/host/lib/rfnoc/actions.cpp @@ -66,20 +66,24 @@ rx_event_action_info::sptr rx_event_action_info::make() /*** TX Metadata Action Info *************************************************/ tx_event_action_info::tx_event_action_info( - uhd::async_metadata_t::event_code_t event_code_) - : action_info(ACTION_KEY_TX_EVENT), event_code(event_code_) + uhd::async_metadata_t::event_code_t event_code_, const boost::optional& tsf_) + : action_info(ACTION_KEY_TX_EVENT), event_code(event_code_), has_tsf(tsf_) { + if (has_tsf) { + tsf = tsf_.get(); + } } tx_event_action_info::sptr tx_event_action_info::make( - uhd::async_metadata_t::event_code_t event_code) + uhd::async_metadata_t::event_code_t event_code, const boost::optional& tsf) { struct tx_event_action_info_make_shared : public tx_event_action_info { - tx_event_action_info_make_shared(uhd::async_metadata_t::event_code_t event_code) - : tx_event_action_info(event_code) + tx_event_action_info_make_shared(uhd::async_metadata_t::event_code_t event_code, + const boost::optional& tsf) + : tx_event_action_info(event_code, tsf) { } }; - return std::make_shared(event_code); + return std::make_shared(event_code, tsf); } -- cgit v1.2.3