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 <[email protected]> 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++. >https://wiki.gnuradio.org/index.php/Guided_Tutorial_Programming_Topics#5.3_Message_Passing >, > >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 <[email protected]> >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 >> > > > >-- >*Laura Arjona * >Washington Research Foundation Innovation Postdoctoral Fellow in >Neuroengineering > >*Paul G. Allen Center for Computer Science & Engineering* >185 E Stevens Way NE >University of Washington >Seattle, WA 98195-2350
_______________________________________________ Discuss-gnuradio mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
