summaryrefslogtreecommitdiff
path: root/gr-uhd/lib/usrp_block_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gr-uhd/lib/usrp_block_impl.cc')
-rw-r--r--gr-uhd/lib/usrp_block_impl.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/gr-uhd/lib/usrp_block_impl.cc b/gr-uhd/lib/usrp_block_impl.cc
index 5eab8fad0f..7e6a140780 100644
--- a/gr-uhd/lib/usrp_block_impl.cc
+++ b/gr-uhd/lib/usrp_block_impl.cc
@@ -487,15 +487,18 @@ void usrp_block_impl::msg_handler_command(pmt::pmt_t msg)
}
// End of legacy backward compat code.
- // Apparently, pmt::is_dict does not return true for pairs anymore. Yeah!
- if (pmt::is_pair(msg)) {
- GR_LOG_DEBUG(d_logger,
- boost::format("Command message is pair, converting to dict: %s") %
- msg);
+ // pmt_dict is a subclass of pmt_pair. Make sure we use pmt_pair!
+ // Old behavior was that these checks were interchangably. Be aware of this change!
+ if (!(pmt::is_dict(msg)) && pmt::is_pair(msg)) {
+ GR_LOG_DEBUG(
+ d_logger,
+ boost::format(
+ "Command message is pair, converting to dict: '%s': car(%s), cdr(%s)") %
+ msg % pmt::car(msg) % pmt::cdr(msg));
msg = pmt::dict_add(pmt::make_dict(), pmt::car(msg), pmt::cdr(msg));
}
- // Turn pair into dict
+ // Make sure, we use dicts!
if (!pmt::is_dict(msg)) {
GR_LOG_ERROR(d_logger,
boost::format("Command message is neither dict nor pair: %s") % msg);