On 06/23/2012 07:50 PM, Stephen wrote: > > Hi, > > I have a question about gr_message. Does gr_message work with anything > but strings? I see where a call to gr_make_message_from_string copies > the string into the message but I don't see anything done with arg1 or > arg2. The same for just creating a message and passing in arg1 and arg2. > I don't see them ever put into the message. Am I not understanding > something or are strings the only message data that works? > > stephen >
gr_message is basically just a binary blob (aka a string) and like 2 or 3 random integers. The scope plotter makes use of arg1 and arg2 for example, so its really up to the implementation to interpret the blob and the args. I suspect the args were added when the author got sick of parsing integers out of the blob. :-) If you want something more structured than a simple blob, gnuradio has basically replaced the need for gr_message with the PMT library and the the gr_msg_queue with the gruel::msg_queue. Unfortunately, all of the existing code (basically wx gui and those horrid benchmark examples) does not use the new stuff. See relevant headers here: http://gnuradio.org/cgit/gnuradio.git/tree/gruel/src/include/gruel/pmt.h http://gnuradio.org/cgit/gnuradio.git/tree/gruel/src/include/gruel/msg_queue.h And if you want something even *more* structured, here is a formal message passing API implemented at the gnuradio block level with PMTs: https://github.com/guruofquality/grextras/wiki#wiki-feature-message-passing -josh > _______________________________________________ > Discuss-gnuradio mailing list > [email protected] > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio > _______________________________________________ Discuss-gnuradio mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
