aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests/actions_test.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-05-31 21:18:15 -0700
committerMartin Braun <martin.braun@ettus.com>2019-11-26 11:49:18 -0800
commit15c058015f56cfcd0e42cf6779a6e6ef6e0da911 (patch)
tree82a4c9311fea7c2eafab371e00bfef00e05596b8 /host/tests/actions_test.cpp
parent73171698b55133aaeab461781476b02c4416da8f (diff)
downloaduhd-15c058015f56cfcd0e42cf6779a6e6ef6e0da911.tar.gz
uhd-15c058015f56cfcd0e42cf6779a6e6ef6e0da911.tar.bz2
uhd-15c058015f56cfcd0e42cf6779a6e6ef6e0da911.zip
rfnoc: Use RTTI "serialization" for stream commands
A small modification to rfnoc::action_info makes it polymorphic, and instead of serializing data structures into a string, this allows creating custom action objects and identifying them via RTTI. The stream command action object is a good example for how to use this, so all the usages of stream command action objects were converted to this scheme.
Diffstat (limited to 'host/tests/actions_test.cpp')
-rw-r--r--host/tests/actions_test.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/host/tests/actions_test.cpp b/host/tests/actions_test.cpp
index c0344eacf..b5feb2521 100644
--- a/host/tests/actions_test.cpp
+++ b/host/tests/actions_test.cpp
@@ -25,10 +25,8 @@ BOOST_AUTO_TEST_CASE(test_actions_single_node)
// Define some mock nodes:
mock_radio_node_t mock_radio(0);
- auto stream_cmd = action_info::make(STREAM_CMD_KEY);
- std::string cmd_payload = "START";
- stream_cmd->payload = std::vector<uint8_t>(cmd_payload.begin(), cmd_payload.end());
-
+ auto stream_cmd =
+ stream_cmd_action_info::make(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);
auto other_cmd = action_info::make("FOO");
node_accessor.send_action(&mock_radio, {res_source_info::INPUT_EDGE, 0}, stream_cmd);