Jonathon, I have been working on this the last two days and can't seem
to get it working. My destructor looks like this:
dataGenerator_impl::~dataGenerator_impl()
{
std::cout << "In here3.\n";
uhd::rfnoc::dataGenerator_block_ctrl temp;
temp.issue_stream_cmd(::uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS, 0);
}
I never see the print statement get printed out, so I don't believe that
the destructor is getting called properly.
My public class for issue_stream_cmd is a direct copy from siggen, but
it doesn't seem to be getting called since the destructor isn't getting
called:
void issue_stream_cmd(const uhd::stream_cmd_t &stream_cmd, const
size_t)
{
std::cout << "In here1.\n";
UHD_RFNOC_BLOCK_TRACE() << "issue_stream_cmd() " << std::endl;
if (not stream_cmd.stream_now) {
throw uhd::not_implemented_error("dataGenerator_block does
not support timed commands.");
}
std::cout << "In here2.\n";
switch (stream_cmd.stream_mode) {
case uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS:
sr_write("ENABLE", true);
break;
case uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS:
sr_write("ENABLE", false);
break;
case uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE:
case uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_MORE:
throw uhd::not_implemented_error("dataGenerator_block
does not support streaming modes other than CONTINUOUS");
default:
UHD_THROW_INVALID_CODE_PATH();
}
}
Any idea what step I am missing?
On 07/24/2017 01:57 PM, Jonathon Pendlum wrote:
It would also be a good idea to add a sr_write to turn off the enable
in your block's destructor code too.
_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com