discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Insert messages in queues?


From: Martin Braun
Subject: Re: [Discuss-gnuradio] Insert messages in queues?
Date: Sun, 12 Apr 2015 23:33:13 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 12.04.2015 15:22, madengr wrote:
Thanks Martin.  Looking at the gr-blocks/examples/msg_passing, the tutorial
link, and qa_msg, I only find examples of posting messages. Those make
sense, but is there an equivalent to _post method that pulls messages?

http://gnuradio.org/doc/doxygen/classgr_1_1basic__block.html#a8501714cb14c1a08b4ff55761600f3a5

 From the above docs, I see the delete_head_blocking, which is maybe what I
want.  If I have a tagged stream to PDU like below, how do I pull the
message?

sink=blocks.tagged_stream_to_pdu(blocks.float_t, "packet_len")
sink.to_basic_block.???????

So you want pop messages from outside the block, right? Is the original block written in C++?

delete_head_block() should work, but this seems unusual. Typically, we have two mechanisms of handling messages: Dedicated message handler callbacks, or we pop the queue ourselves in work() using delete_head().

If you're popping messages outside of the block, the block itself would never see or use those messages -- which is why I'm surprised. You might be better of writing a mini-Python-block that handles the messages.

Cheers,
M


Lou


Martin Braun-2 wrote

Hey Louis,

Yes, there are two ways, and they're completely different. The old
message queues will be deprecated soon, so anything with gr.msg_queue()
in there will, at one point in the future, stop working.

Look at the Python output of some of the message examples we provide,
also check out this manual page:
http://gnuradio.org/doc/doxygen/page_msg_passing.html

M

_______________________________________________
Discuss-gnuradio mailing list

Discuss-gnuradio@

https://lists.gnu.org/mailman/listinfo/discuss-gnuradio





--
View this message in context: 
http://gnuradio.4.n7.nabble.com/Insert-messages-in-queues-tp53272p53277.html
Sent from the GnuRadio mailing list archive at Nabble.com.

_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio





reply via email to

[Prev in Thread] Current Thread [Next in Thread]