GRC - wrapping a GNU Radio block that uses message_sink


I have a 3rd party GNU Radio block of signal processing code that I
like to wrap for use within GRC. This block uses a message sink (i.e a
pointer to a gnu radio message queue is passed into the block which
to then utilise the queue for inserting ‘send frequency correction’
to another process. I have read that GRC currently supports users
block wrappers for blocks with message queue IO. In the xml file I
write, is
the message queue a second ‘sink’, i.e in addition to the standard float
stream of samples it outputs, or should it be handled in the parameter
section of the xml code? I’ve searched all existing standard blocks and
haven’t found an example to work from. Does anyone have an example they
could share?

Or have I also got my source and sink perspectives confused and this
should instead be a msg source? Even so, my questions above remain.

Many thanks.


A message sink takes a gr_stream in, and outputs a message. Vice-versa
for message source block.

In grc, set the block wrapper port (source or sink) to type “msg”. When
you connect two blocks with type “msg”. GRC creates a message queue
called $(sink_block_id)_msgq_out and $(source_block_id)_msgq_in. The
blocks using the message queue should expect a variable of this name to
exist and can pass the message queue as an argument to the hier block or
message block constructor.

See the grc/blocks/gr_message_source(sink) blocks as examples.