From 15c058015f56cfcd0e42cf6779a6e6ef6e0da911 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Fri, 31 May 2019 21:18:15 -0700 Subject: 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. --- host/tests/actions_test.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'host/tests/actions_test.cpp') 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(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); -- cgit v1.2.3