GRC Message Source/Sink and Packet Source

Hi!

I’m trying to integrate an existing Packet Source into GRC. I have
some trouble understanding how this is supposed to work:

In order to send a packet I need to use the gr_message_queue. How do I
call a function to add a message to a queue from GRC?

My Packet Source is supposed to define a message. A Message Sink takes
one input. I connect that input with a Message Source. I understand
that in this case the Sink accepts data.
A packet is a byte data structure. So I want to send bytes to Message
Sink. How can I return a byte structure into the message sink now? Is
there any code that does that with GRC block? I know that
transmit_path.py or benchmark_tx.py do that, but they are not
separated. Therefore it’s by far simpler here.

Best,
Marius

On 06/05/2012 03:17 AM, Marius wrote:

Hi!

I’m trying to integrate an existing Packet Source into GRC. I have
some trouble understanding how this is supposed to work:

Actually, this packet sink is integrated into GRC and the design is
actually as regrettable as you can imagine:

http://gnuradio.org/cgit/gnuradio.git/tree/grc/grc_gnuradio/blks2/packet.py

http://gnuradio.org/cgit/gnuradio.git/tree/grc/blocks/blks2_packet_encoder.xml

http://gnuradio.org/cgit/gnuradio.git/tree/grc/blocks/blks2_packet_decoder.xml

The blocks have stream IO all the way, which means there is code slicing
up the stream and feeding the message queue; yes, and spitting it back
out to stream for the decoder.

It probably would be better to have offered a message queue as the input
or output, but these were written before GRC supported message queues.

I also created a version of this packet framer/deframer which uses the
PMT message passing feature instead, there is a nice screenshot in the
message section: Home · guruofquality/grextras Wiki · GitHub

-josh