discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Problem with messages and msg_queue


From: Trond Danielsen
Subject: Re: [Discuss-gnuradio] Problem with messages and msg_queue
Date: Thu, 10 May 2007 10:24:04 +0200

2007/5/10, Eric Blossom <address@hidden>:
On Wed, May 09, 2007 at 11:14:43PM +0200, Trond Danielsen wrote:
> 2007/5/9, Eric Blossom <address@hidden>:
> >On Wed, May 09, 2007 at 08:12:05PM +0200, Trond Danielsen wrote:
> >> Hi everyone,
> >>
> >> I've got a problem with messages and message queues. The problem is
> >> simply that I just cannot figure out how to use them. I tried the
> >> simple program that is attached to this email (test.py), and the
> >> result is in test.log. If anybody has the time to take a quick look at
> >> the code and point me in the right direction, I would be very
> >> thankful!
> >>
> >> Regards,
> >>
> >> --
> >> Trond Danielsen
> >
> >
> >This looks correct, and in fact you are receiving a payload that's 800
> >bytes long (== 200 * sizeof(float)), so everything looks good.
> >
> >In reality, you'd want to do something with the payload:
> >
> >  payload = msg.to_string()  # return payload as an python string
> >
> >  foo = struct.unpack(format, payload)
> >
> >See gnuradio-core/src/python/gnuradio/blksimpl/pkt.py for a real-life
> >example.
> >
> >Eric
>
> Ok, I guess I misunderstood one thing: I assumed that gr.message_sink(
> gr.sizeof_float, ...) would set the payload size for each packet to 4
> bytes.

No, that would kill our performance.

Eric


Ok, I read from pkt.py that to finish a packet, I just append
gr.message(1) at the tail of the message queue, but is there a simple
way to do this if I just want to send packet of fixed size, where the
payload comes from a flow graph?
--
Trond Danielsen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]