diff options
Diffstat (limited to 'host')
| -rw-r--r-- | host/include/uhd/rfnoc/actions.hpp | 8 | ||||
| -rw-r--r-- | host/lib/rfnoc/actions.cpp | 12 | ||||
| -rw-r--r-- | host/lib/rfnoc/radio_control_impl.cpp | 11 | 
3 files changed, 18 insertions, 13 deletions
| diff --git a/host/include/uhd/rfnoc/actions.hpp b/host/include/uhd/rfnoc/actions.hpp index 681a9da3d..52e6b9287 100644 --- a/host/include/uhd/rfnoc/actions.hpp +++ b/host/include/uhd/rfnoc/actions.hpp @@ -70,13 +70,13 @@ public:      using sptr = std::shared_ptr<rx_event_action_info>;      //! The error code that describes the event -    uhd::rx_metadata_t::error_code_t error_code = uhd::rx_metadata_t::ERROR_CODE_NONE; +    uhd::rx_metadata_t::error_code_t error_code;      //! Factory function -    static sptr make(); +    static sptr make(uhd::rx_metadata_t::error_code_t error_code); -private: -    rx_event_action_info(); +protected: +    rx_event_action_info(uhd::rx_metadata_t::error_code_t error_code);  };  struct UHD_API tx_event_action_info : public action_info diff --git a/host/lib/rfnoc/actions.cpp b/host/lib/rfnoc/actions.cpp index ecc1b3f20..3276c456c 100644 --- a/host/lib/rfnoc/actions.cpp +++ b/host/lib/rfnoc/actions.cpp @@ -51,17 +51,23 @@ stream_cmd_action_info::sptr stream_cmd_action_info::make(  }  /*** RX Metadata Action Info *************************************************/ -rx_event_action_info::rx_event_action_info() : action_info(ACTION_KEY_RX_EVENT) +rx_event_action_info::rx_event_action_info(uhd::rx_metadata_t::error_code_t error_code_) +    : action_info(ACTION_KEY_RX_EVENT), error_code(error_code_)  {      // nop  } -rx_event_action_info::sptr rx_event_action_info::make() +rx_event_action_info::sptr rx_event_action_info::make( +    uhd::rx_metadata_t::error_code_t error_code)  {      struct rx_event_action_info_make_shared : public rx_event_action_info      { +        rx_event_action_info_make_shared(uhd::rx_metadata_t::error_code_t error_code) +            : rx_event_action_info(error_code) +        { +        }      }; -    return std::make_shared<rx_event_action_info_make_shared>(); +    return std::make_shared<rx_event_action_info_make_shared>(error_code);  }  /*** TX Metadata Action Info *************************************************/ diff --git a/host/lib/rfnoc/radio_control_impl.cpp b/host/lib/rfnoc/radio_control_impl.cpp index 6c7a769df..ea67d891e 100644 --- a/host/lib/rfnoc/radio_control_impl.cpp +++ b/host/lib/rfnoc/radio_control_impl.cpp @@ -966,9 +966,9 @@ void radio_control_impl::async_message_handler(              switch (code) {                  case err_codes::ERR_RX_OVERRUN: {                      UHD_LOG_FASTPATH("O"); -                    auto rx_event_action        = rx_event_action_info::make(); -                    rx_event_action->error_code = uhd::rx_metadata_t::ERROR_CODE_OVERFLOW; -                    const bool cont_mode        = _last_stream_cmd.at(chan).stream_mode +                    auto rx_event_action = rx_event_action_info::make( +                        uhd::rx_metadata_t::ERROR_CODE_OVERFLOW); +                    const bool cont_mode = _last_stream_cmd.at(chan).stream_mode                                             == stream_cmd_t::STREAM_MODE_START_CONTINUOUS;                      rx_event_action->args["cont_mode"] = std::to_string(cont_mode);                      RFNOC_LOG_TRACE("Posting overrun event action message."); @@ -978,9 +978,8 @@ void radio_control_impl::async_message_handler(                  }                  case err_codes::ERR_RX_LATE_CMD:                      UHD_LOG_FASTPATH("L"); -                    auto rx_event_action = rx_event_action_info::make(); -                    rx_event_action->error_code = -                        uhd::rx_metadata_t::ERROR_CODE_LATE_COMMAND; +                    auto rx_event_action = rx_event_action_info::make( +                        uhd::rx_metadata_t::ERROR_CODE_LATE_COMMAND);                      RFNOC_LOG_TRACE("Posting RX late command message.");                      post_action(res_source_info{res_source_info::OUTPUT_EDGE, chan},                          rx_event_action); | 
