discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] OOT blocks not imported when using extern variabl


From: Adrian Musceac
Subject: Re: [Discuss-gnuradio] OOT blocks not imported when using extern variables in C++
Date: Sun, 21 Oct 2018 12:29:09 +0000

Hi Laura,
I think the header/payload demux block implements such a mechanism (act on the sample stream based on a message received from a block down stream). Perhaps this example code will be useful to you.

Regards,
Adrian

On October 20, 2018 6:20:32 PM UTC, Laura Arjona <address@hidden> wrote:
Thank you again, I really appreciate your collaboration.

One last question, is there any simple example online, about passing an int value (for example) between two OOT blocks in C++?

I know there is this example in python, but I was wondering if there is simple but complete one in C++.

From reading the previous tutorial, I have set the following in my block2_impl.cc class

set_msg_handler(
    pmt::mp("in_port_block2"), // This is the port identifier
    boost::bind(&block2_impl::msg_handler_method, this, _1) 
);


And then I declare the methon in the block2_impl.h file
void msg_handler_method(pmt::pmt_t msg);

Then, how do I send an int value from block2 to block1 in the general_work function, and how do I retrieve the value in block1 in also the general_work function ?

Thanks!

On Sat, Oct 20, 2018 at 9:28 AM, Sylvain Munaut <address@hidden> wrote:
> Then, it let's say you have this system uhd_source -> block1 -> block2 -> block3 -> uhd_sink,
> how would you trigger different actions on block1 based on the result of one function of block3?

https://www.gnuradio.org/doc/doxygen/page_msg_passing.html

 Cheers,

     Sylvain



reply via email to

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