diff options
Diffstat (limited to 'gr-uhd/lib/usrp_block_impl.cc')
-rw-r--r-- | gr-uhd/lib/usrp_block_impl.cc | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/gr-uhd/lib/usrp_block_impl.cc b/gr-uhd/lib/usrp_block_impl.cc index 2ce7aa3b39..5eab8fad0f 100644 --- a/gr-uhd/lib/usrp_block_impl.cc +++ b/gr-uhd/lib/usrp_block_impl.cc @@ -487,6 +487,14 @@ 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); + msg = pmt::dict_add(pmt::make_dict(), pmt::car(msg), pmt::cdr(msg)); + } + // Turn pair into dict if (!pmt::is_dict(msg)) { GR_LOG_ERROR(d_logger, @@ -494,17 +502,6 @@ void usrp_block_impl::msg_handler_command(pmt::pmt_t msg) return; } - // OK, here comes the horrible part. Pairs pass is_dict(), but they're not dicts. Such - // dicks. - try { - // This will fail if msg is a pair: - pmt::pmt_t keys = pmt::dict_keys(msg); - } catch (const pmt::wrong_type& e) { - // So we fix it: - GR_LOG_DEBUG(d_debug_logger, boost::format("Converting pair to dict: %s") % msg); - msg = pmt::dict_add(pmt::make_dict(), pmt::car(msg), pmt::cdr(msg)); - } - /*** Start the actual message processing *************************/ /// 1) Check if there's a time stamp if (pmt::dict_has_key(msg, cmd_time_key())) { |