USRP Hardware Driver and Device Manual Version: 4.10.0.0_release
UHD and USRP Manual
 
Loading...
Searching...
No Matches
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>
12#include <uhd/types/ranges.hpp>
17#include <boost/optional.hpp>
18#include <cstddef>
19#include <cstdint>
20#include <memory>
21#include <optional>
22#include <string>
23#include <vector>
24
25namespace uhd { namespace rfnoc {
26
35{
36public:
37 virtual ~action_info() {}
38
39 using sptr = std::shared_ptr<action_info>;
41 const size_t id;
43 std::string key;
45 // (de-)serialize it.
46 std::vector<uint8_t> payload;
49
51 static sptr make(const std::string& key = "",
53
54protected:
56 const std::string& key, const uhd::device_addr_t& args = uhd::device_addr_t(""));
57};
58
59struct UHD_API stream_cmd_action_info : public action_info
60{
61public:
62 using sptr = std::shared_ptr<stream_cmd_action_info>;
63
65
67 static sptr make(const uhd::stream_cmd_t::stream_mode_t stream_mode);
68
69private:
70 stream_cmd_action_info(const uhd::stream_cmd_t::stream_mode_t stream_mode);
71};
72
87
89{
90public:
91 using sptr = std::shared_ptr<tx_event_action_info>;
92
95
97 bool has_tsf;
98
100 uint64_t tsf;
101
104 const std::optional<uint64_t>& tsf);
105
107 //
108 // Required to avoid ambiguity between boost and std versions when using
109 // timestamp directly.
111
113 [[deprecated("Prefer std::optional over boost::optional.")]] static sptr make(
115 const boost::optional<uint64_t>& tsf);
116
117protected:
119 const std::optional<uint64_t>& tsf);
120};
121
123struct UHD_API tune_request_action_info : public action_info
124{
125public:
126 using sptr = std::shared_ptr<tune_request_action_info>;
127
136
137private:
138 tune_request_action_info(const uhd::tune_request_t tune_request);
139};
140
141}} /* namespace uhd::rfnoc */
Definition device_addr.hpp:39
Definition time_spec.hpp:31
#define UHD_API
Definition config.h:87
Definition actions.hpp:25
Definition build_info.hpp:12
meta_range_t freq_range_t
Definition ranges.hpp:171
event_code_t
Definition metadata.hpp:216
std::vector< uint8_t > payload
An arbitrary payload. It is up to consumers and producers to.
Definition actions.hpp:46
std::string key
A string identifier for this action.
Definition actions.hpp:43
virtual ~action_info()
Definition actions.hpp:37
const size_t id
A unique counter for this action.
Definition actions.hpp:41
action_info(const std::string &key, const uhd::device_addr_t &args=uhd::device_addr_t(""))
std::shared_ptr< action_info > sptr
Definition actions.hpp:39
static sptr make(const std::string &key="", const uhd::device_addr_t &args=uhd::device_addr_t(""))
Factory function.
uhd::device_addr_t args
A dictionary of key-value pairs. May be used as desired.
Definition actions.hpp:48
std::shared_ptr< rx_event_action_info > sptr
Definition actions.hpp:76
static sptr make(uhd::rx_metadata_t::error_code_t error_code)
Factory function.
rx_event_action_info(uhd::rx_metadata_t::error_code_t error_code)
uhd::rx_metadata_t::error_code_t error_code
The error code that describes the event.
Definition actions.hpp:79
std::shared_ptr< stream_cmd_action_info > sptr
Definition actions.hpp:62
static sptr make(const uhd::stream_cmd_t::stream_mode_t stream_mode)
Factory function.
uhd::stream_cmd_t stream_cmd
Definition actions.hpp:64
static sptr make(const uhd::tune_request_t tune_request)
Factory function.
uhd::freq_range_t overall_freq_range
Definition actions.hpp:133
uhd::tune_request_t tune_request
Definition actions.hpp:128
uhd::time_spec_t time_spec
Definition actions.hpp:129
std::shared_ptr< tune_request_action_info > sptr
Definition actions.hpp:126
uhd::freq_range_t rf_range
Definition actions.hpp:132
uhd::tune_result_t tune_result
Definition actions.hpp:130
uhd::freq_range_t dsp_range
Definition actions.hpp:131
tx_event_action_info(uhd::async_metadata_t::event_code_t event_code, const std::optional< uint64_t > &tsf)
uint64_t tsf
When the async event occurred.
Definition actions.hpp:100
static sptr make(uhd::async_metadata_t::event_code_t event_code, const boost::optional< uint64_t > &tsf)
Factory function (legacy, to support boost::optional)
static sptr make(uhd::async_metadata_t::event_code_t event_code, const std::optional< uint64_t > &tsf)
Factory function.
bool has_tsf
Has time specification?
Definition actions.hpp:97
std::shared_ptr< tx_event_action_info > sptr
Definition actions.hpp:91
uhd::async_metadata_t::event_code_t event_code
The event code that describes the event.
Definition actions.hpp:94
static sptr make(uhd::async_metadata_t::event_code_t event_code, uint64_t tsf)
Factory function.
error_code_t
Definition metadata.hpp:113
Definition stream_cmd.hpp:42
stream_mode_t
Definition stream_cmd.hpp:43
Definition tune_request.hpp:25
Definition tune_result.hpp:19