0

This tutorial on the GNURadio website shows that you can add a parameter to an OOT block by adding something like:

d_grey_code(grey_code)

to the block constructor after the output parameters, and adding

bool d_grey_code;

to the header file.

Doing this works fine, however, if I instantiate this block in a GR flowgraph and start a program, then "grey_code" is only updated at the start of the program.

If I set "grey code" to a variable and change it after the program starts, this change is not recongnized within the block.

Is there a method to create a parameter for an OOT block which will respond to changes in its value after a block is initialized?

Zephyr
  • 337
  • 5
  • 23

1 Answers1

0

Yes,

This is done via a callback. There are many examples of blocks that have callbacks. A quick look at gr-blocks and I found blocks_add_const_vxx.xml has a callback to set the constant. I suggest you look at the source for that block and understand how the "set_k" callback is defined, then try to replicate for your needs. Good luck.

eeKnud
  • 96
  • 8