Loading...
Searching...
No Matches
actions.hpp
Go to the documentation of this file.
//
// Copyright 2019 Ettus Research, a National Instruments Brand
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
#pragma once
#include <uhd/config.hpp>
#include <uhd/types/device_addr.hpp>
#include <uhd/types/metadata.hpp>
#include <uhd/types/ranges.hpp>
#include <uhd/types/stream_cmd.hpp>
#include <uhd/types/time_spec.hpp>
#include <uhd/types/tune_request.hpp>
#include <uhd/types/tune_result.hpp>
#include <boost/optional.hpp>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <string>
#include <vector>
namespace uhd { namespace rfnoc {
struct UHD_API action_info
{
public:
virtual ~action_info() {}
using sptr = std::shared_ptr<action_info>;
const size_t id;
std::string key;
// (de-)serialize it.
std::vector<uint8_t> payload;
uhd::device_addr_t args;
static sptr make(const std::string& key = "",
const uhd::device_addr_t& args = uhd::device_addr_t(""));
protected:
action_info(
const std::string& key, const uhd::device_addr_t& args = uhd::device_addr_t(""));
};
struct UHD_API stream_cmd_action_info : public action_info
{
public:
using sptr = std::shared_ptr<stream_cmd_action_info>;
uhd::stream_cmd_t stream_cmd;
static sptr make(const uhd::stream_cmd_t::stream_mode_t stream_mode);
private:
stream_cmd_action_info(const uhd::stream_cmd_t::stream_mode_t stream_mode);
};
struct UHD_API rx_event_action_info : public action_info
{
public:
using sptr = std::shared_ptr<rx_event_action_info>;
uhd::rx_metadata_t::error_code_t error_code;
static sptr make(uhd::rx_metadata_t::error_code_t error_code);
protected:
rx_event_action_info(uhd::rx_metadata_t::error_code_t error_code);
};
struct UHD_API tx_event_action_info : public action_info
{
public:
using sptr = std::shared_ptr<tx_event_action_info>;
uhd::async_metadata_t::event_code_t event_code;
bool has_tsf;
uint64_t tsf;
static sptr make(uhd::async_metadata_t::event_code_t event_code,
const boost::optional<uint64_t>& tsf);
protected:
tx_event_action_info(uhd::async_metadata_t::event_code_t event_code,
const boost::optional<uint64_t>& tsf);
};
struct UHD_API tune_request_action_info : public action_info
{
public:
using sptr = std::shared_ptr<tune_request_action_info>;
uhd::tune_request_t tune_request;
uhd::time_spec_t time_spec;
uhd::tune_result_t tune_result;
uhd::freq_range_t dsp_range;
uhd::freq_range_t rf_range;
uhd::freq_range_t overall_freq_range;
static sptr make(const uhd::tune_request_t tune_request);
private:
tune_request_action_info(const uhd::tune_request_t tune_request);
};
}} /* namespace uhd::rfnoc */
uhd::device_addr_t
Definition device_addr.hpp:39
uhd::time_spec_t
Definition time_spec.hpp:31
UHD_API
#define UHD_API
Definition config.h:87
config.hpp
device_addr.hpp
metadata.hpp
uhd::rfnoc
Definition actions.hpp:24
uhd
Definition build_info.hpp:12
uhd::freq_range_t
meta_range_t freq_range_t
Definition ranges.hpp:131
ranges.hpp
stream_cmd.hpp
uhd::async_metadata_t::event_code_t
event_code_t
Definition metadata.hpp:216
uhd::rfnoc::action_info::payload
std::vector< uint8_t > payload
An arbitrary payload. It is up to consumers and producers to.
Definition actions.hpp:45
uhd::rfnoc::action_info::key
std::string key
A string identifier for this action.
Definition actions.hpp:42
uhd::rfnoc::action_info::~action_info
virtual ~action_info()
Definition actions.hpp:36
uhd::rfnoc::action_info::id
const size_t id
A unique counter for this action.
Definition actions.hpp:40
uhd::rfnoc::action_info::action_info
action_info(const std::string &key, const uhd::device_addr_t &args=uhd::device_addr_t(""))
uhd::rfnoc::action_info::sptr
std::shared_ptr< action_info > sptr
Definition actions.hpp:38
uhd::rfnoc::action_info::make
static sptr make(const std::string &key="", const uhd::device_addr_t &args=uhd::device_addr_t(""))
Factory function.
uhd::rfnoc::action_info::args
uhd::device_addr_t args
A dictionary of key-value pairs. May be used as desired.
Definition actions.hpp:47
uhd::rfnoc::rx_event_action_info::sptr
std::shared_ptr< rx_event_action_info > sptr
Definition actions.hpp:75
uhd::rfnoc::rx_event_action_info::make
static sptr make(uhd::rx_metadata_t::error_code_t error_code)
Factory function.
uhd::rfnoc::rx_event_action_info::rx_event_action_info
rx_event_action_info(uhd::rx_metadata_t::error_code_t error_code)
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:78
uhd::rfnoc::stream_cmd_action_info::sptr
std::shared_ptr< stream_cmd_action_info > sptr
Definition actions.hpp:61
uhd::rfnoc::stream_cmd_action_info::make
static sptr make(const uhd::stream_cmd_t::stream_mode_t stream_mode)
Factory function.
uhd::rfnoc::stream_cmd_action_info::stream_cmd
uhd::stream_cmd_t stream_cmd
Definition actions.hpp:63
uhd::rfnoc::tune_request_action_info::make
static sptr make(const uhd::tune_request_t tune_request)
Factory function.
uhd::rfnoc::tune_request_action_info::overall_freq_range
uhd::freq_range_t overall_freq_range
Definition actions.hpp:121
uhd::rfnoc::tune_request_action_info::tune_request
uhd::tune_request_t tune_request
Definition actions.hpp:116
uhd::rfnoc::tune_request_action_info::time_spec
uhd::time_spec_t time_spec
Definition actions.hpp:117
uhd::rfnoc::tune_request_action_info::sptr
std::shared_ptr< tune_request_action_info > sptr
Definition actions.hpp:114
uhd::rfnoc::tune_request_action_info::rf_range
uhd::freq_range_t rf_range
Definition actions.hpp:120
uhd::rfnoc::tune_request_action_info::tune_result
uhd::tune_result_t tune_result
Definition actions.hpp:118
uhd::rfnoc::tune_request_action_info::dsp_range
uhd::freq_range_t dsp_range
Definition actions.hpp:119
uhd::rfnoc::tx_event_action_info::tsf
uint64_t tsf
When the async event occurred.
Definition actions.hpp:99
uhd::rfnoc::tx_event_action_info::tx_event_action_info
tx_event_action_info(uhd::async_metadata_t::event_code_t event_code, const boost::optional< uint64_t > &tsf)
uhd::rfnoc::tx_event_action_info::make
static sptr make(uhd::async_metadata_t::event_code_t event_code, const boost::optional< uint64_t > &tsf)
Factory function.
uhd::rfnoc::tx_event_action_info::has_tsf
bool has_tsf
Has time specification?
Definition actions.hpp:96
uhd::rfnoc::tx_event_action_info::sptr
std::shared_ptr< tx_event_action_info > sptr
Definition actions.hpp:90
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:93
uhd::rx_metadata_t::error_code_t
error_code_t
Definition metadata.hpp:113
uhd::stream_cmd_t
Definition stream_cmd.hpp:40
uhd::stream_cmd_t::stream_mode_t
stream_mode_t
Definition stream_cmd.hpp:41
uhd::tune_request_t
Definition tune_request.hpp:25
uhd::tune_result_t
Definition tune_result.hpp:19
time_spec.hpp
tune_request.hpp
tune_result.hpp