USRP Hardware Driver and USRP Manual  Version: 4.4.0.HEAD-0-g5fac246b
UHD and USRP Manual
actions.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2019 Ettus Research, a National Instruments Brand
3 //
4 // SPDX-License-Identifier: GPL-3.0-or-later
5 //
6 
7 #pragma once
8 
9 #include <uhd/config.hpp>
11 #include <uhd/types/metadata.hpp>
12 #include <uhd/types/stream_cmd.hpp>
13 #include <boost/optional.hpp>
14 #include <memory>
15 #include <string>
16 #include <vector>
17 
18 namespace uhd { namespace rfnoc {
19 
28 {
29 public:
30  virtual ~action_info() {}
31 
32  using sptr = std::shared_ptr<action_info>;
34  const size_t id;
36  std::string key;
38  // (de-)serialize it.
39  std::vector<uint8_t> payload;
42 
44  static sptr make(const std::string& key = "",
45  const uhd::device_addr_t& args = uhd::device_addr_t(""));
46 
47 protected:
49  const std::string& key, const uhd::device_addr_t& args = uhd::device_addr_t(""));
50 };
51 
53 {
54 public:
55  using sptr = std::shared_ptr<stream_cmd_action_info>;
56 
58 
60  static sptr make(const uhd::stream_cmd_t::stream_mode_t stream_mode);
61 
62 private:
64 };
65 
67 {
68 public:
69  using sptr = std::shared_ptr<rx_event_action_info>;
70 
73 
75  static sptr make(uhd::rx_metadata_t::error_code_t error_code);
76 
77 protected:
79 };
80 
82 {
83 public:
84  using sptr = std::shared_ptr<tx_event_action_info>;
85 
88 
90  bool has_tsf;
91 
93  uint64_t tsf;
94 
96  static sptr make(uhd::async_metadata_t::event_code_t event_code,
97  const boost::optional<uint64_t>& tsf);
98 
99 protected:
101  const boost::optional<uint64_t>& tsf);
102 };
103 
104 }} /* namespace uhd::rfnoc */
uhd::rfnoc::tx_event_action_info
Definition: actions.hpp:81
device_addr.hpp
config.hpp
uhd::rfnoc::action_info::payload
std::vector< uint8_t > payload
An arbitrary payload. It is up to consumers and producers to.
Definition: actions.hpp:39
uhd::rfnoc::rx_event_action_info
Definition: actions.hpp:66
uhd::rfnoc::action_info::~action_info
virtual ~action_info()
Definition: actions.hpp:30
uhd::rfnoc::action_info::id
const size_t id
A unique counter for this action.
Definition: actions.hpp:34
uhd::rfnoc::rx_event_action_info::error_code
uhd::rx_metadata_t::error_code_t error_code
The error code that describes the event.
Definition: actions.hpp:72
UHD_API
#define UHD_API
Definition: config.h:87
uhd::rfnoc::action_info::args
uhd::device_addr_t args
A dictionary of key-value pairs. May be used as desired.
Definition: actions.hpp:41
stream_cmd.hpp
uhd::device_addr_t
Definition: device_addr.hpp:37
uhd::rfnoc::tx_event_action_info::has_tsf
bool has_tsf
Has time specification?
Definition: actions.hpp:90
uhd::rfnoc::action_info::sptr
std::shared_ptr< action_info > sptr
Definition: actions.hpp:32
uhd
Definition: build_info.hpp:12
uhd::rx_metadata_t::error_code_t
error_code_t
Definition: metadata.hpp:113
uhd::stream_cmd_t
Definition: stream_cmd.hpp:39
uhd::rfnoc::action_info
Definition: actions.hpp:27
metadata.hpp
uhd::stream_cmd_t::stream_mode_t
stream_mode_t
Definition: stream_cmd.hpp:41
uhd::rfnoc::stream_cmd_action_info
Definition: actions.hpp:52
uhd::rfnoc::action_info::key
std::string key
A string identifier for this action.
Definition: actions.hpp:36
uhd::async_metadata_t::event_code_t
event_code_t
Definition: metadata.hpp:216
uhd::rfnoc::tx_event_action_info::event_code
uhd::async_metadata_t::event_code_t event_code
The event code that describes the event.
Definition: actions.hpp:87
uhd::rfnoc::tx_event_action_info::tsf
uint64_t tsf
When the async event occurred.
Definition: actions.hpp:93
uhd::rfnoc::stream_cmd_action_info::stream_cmd
uhd::stream_cmd_t stream_cmd
Definition: actions.hpp:57