diff options
| author | Martin Braun <martin.braun@ettus.com> | 2019-05-30 13:54:44 -0700 | 
|---|---|---|
| committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 11:49:14 -0800 | 
| commit | ad4004f1f78d5b64dae50b6e456d0206e824978f (patch) | |
| tree | df701340ac1d493ee5b7de72985ea1c5f3571ee2 /host/lib | |
| parent | b8a6c64d6012ab1ec0b3b843fccec2d990d440a3 (diff) | |
| download | uhd-ad4004f1f78d5b64dae50b6e456d0206e824978f.tar.gz uhd-ad4004f1f78d5b64dae50b6e456d0206e824978f.tar.bz2 uhd-ad4004f1f78d5b64dae50b6e456d0206e824978f.zip  | |
rfnoc: node: Add default command time API
Diffstat (limited to 'host/lib')
| -rw-r--r-- | host/lib/rfnoc/node.cpp | 23 | 
1 files changed, 23 insertions, 0 deletions
diff --git a/host/lib/rfnoc/node.cpp b/host/lib/rfnoc/node.cpp index d569cea4a..cc2d7b7a9 100644 --- a/host/lib/rfnoc/node.cpp +++ b/host/lib/rfnoc/node.cpp @@ -45,6 +45,29 @@ std::vector<std::string> node_t::get_property_ids() const      return return_value;  } +void node_t::set_command_time(uhd::time_spec_t time, const size_t instance) +{ +    if (_cmd_timespecs.size() <= instance) { +        _cmd_timespecs.resize(instance + 1, uhd::time_spec_t(0.0)); +    } + +    _cmd_timespecs[instance] = time; +} + +uhd::time_spec_t node_t::get_command_time(const size_t instance) const +{ +    if (instance >= _cmd_timespecs.size()) { +        return uhd::time_spec_t::ASAP; +    } + +    return _cmd_timespecs.at(instance); +} + +void node_t::clear_command_time(const size_t instance) +{ +    set_command_time(uhd::time_spec_t(0.0), instance); +} +  /*** Protected methods *******************************************************/  void node_t::register_property(property_base_t* prop, resolve_callback_t&& clean_callback)  {  | 
