# Questions on callback functions implementation of blocks in gr-trellis

**URL:** <https://www.ruby-forum.com/t/questions-on-callback-functions-implementation-of-blocks-in-gr-trellis/240859>\
**Category:** GNU Radio\
**Created:** [May 3, 2014, 8:33am UTC](https://www.ruby-forum.com/t/questions-on-callback-functions-implementation-of-blocks-in-gr-trellis/240859 "2014-05-03T08:33:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [May 3, 2014, 8:33am UTC](https://www.ruby-forum.com/t/questions-on-callback-functions-implementation-of-blocks-in-gr-trellis/240859/1 "2014-05-03T08:33:36Z")

</div>

Hi all,

I’m working on a system with trellis coding and I met a problem with the  
python callback function generated by grc . Because there are several  
parameters used in the blocks needs to be updated. I added callback  
functions for those parameters in those c++ files.

For example, to add callback function for the FSM parameter in the  
viterbi\_combined block, I declared set\_FSM function in  
viterbi\_combined.h ,  
defined the function in viterbi\_combined\_impl.h, and added   
set\_FSM($FSM) in the viterbi\_combined.xml file.

After that, I reinstalled the gnuradio and checked the trellis\_swig.py  
and  
confirmed that python has linked these callback functions in the  
viterbi\_combined class.

But when I execute the grc application, this callback function wasn’t  
automatically generated in the resulting python file. After I added this  
set\_FSM function by myself, the flow graph worked as what I expected.

I’ve added callback functions for other blocks like repack\_bits of  
gr-block  
module. After I’ve done exactly the same thing, the callback function I  
added was correctly generated in python file after I executed in grc.

So my question is: why these callback functions I added in gr-trellis  
weren’t automatically generated in python file after execution in grc  
like  
the other callbacks in gr-blocks? Did I do anything wrong?

I attached my modification on gnuradio in the patch file for your  
reference.

Thanks!

Best,  
Zhe patch.patch  
[http://gnuradio.4.n7.nabble.com/file/n47933/patch.patch](http://gnuradio.4.n7.nabble.com/file/n47933/patch.patch)

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/Questions-on-callback-functions-implementation-of-blocks-in-gr-trellis-tp47933.html](http://gnuradio.4.n7.nabble.com/Questions-on-callback-functions-implementation-of-blocks-in-gr-trellis-tp47933.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).
