Martin,
Yes, pop them outside the block, but also outside of the flow graph.
Exactly reverse of the last example “Posting from External Sources”
here:
http://gnuradio.org/doc/doxygen/page_msg_passing.html
“The last feature of the message passing architecture to discuss here is
how
it can be used to take in messages from an external source. We can call
a
block’s gr::basic_block::_post method directly and pass it a message. So
any
block with an input message port can receive messages from the outside
in
this way.”
I want to take any block with an output message port and _pull that
message
to the outside (of the flow so I can process it in Python).
Presently, with the old queued messaging system, I can use
blocks.message_sink() to take an item into a message queue I can access
outside the flow. Since this will be deprecated, I’d want to use
blocks.tagged_stream_to_pdu() to generate a message, but don’t see a way
to
get those messages stored into a FIFO (queue) and access them outside
the
flow.
As you suggest, maybe the solution is to develop a block, with an input
message port, that performs the callback and stores those messages in a
FIFO. From browsing the documentation, it looks like the message_debug
block will store up messages (I haven’t attempted to read those
messages),
but I’d be worried about overflows. I guess the ideal was to do it
without
developing or modifying any blocks.
Though looking at line 278 of usrp_spectrum_sense.py, when the message
queues are deprecated, what would you do to get the data out of the
flow? I
assume blocks.bin_statistics_f() would have to be re-written to have a
message port output, but then how do you get that message out of the
flow?
https://github.com/gnuradio/gnuradio/blob/master/gr-uhd/examples/python/usrp_spectrum_sense.py#L278
Thanks,
Lou
Martin B.-2 wrote
Cheers,
M
–
View this message in context:
http://gnuradio.4.n7.nabble.com/Insert-messages-in-queues-tp53272p53279.html
Sent from the GnuRadio mailing list archive at Nabble.com.