On Sat, Feb 19, 2011 at 4:52 AM, ichigo.san <ichigo....@gmail.com> wrote:
>
> Hi,
>
> I was wondering if there is a method to have a source block constantly
> sending out "0" and once it recieves a message from python, e.g a packet,
> it
> will then stream the message and switch back to sending "0" when done.
>
> I've tried:
> Message Source ----------------------------> (Add, 0)
> Constant Source/Vector Source with 0 -----> (Add, 1) ---> output
>
> However, the add block (and all blocks in gnuradio) waits for stream items
> from both inputs to be ready (i.e no interpolation) before making a output
> stream item. This effectively nullifies the const source in the above
> example.
>
> I was wondering if there is any possible way to solve this problem?
>
> The reason I am asking this is I am using a dual TX setup on a single USRP
> which interleaves output signals. I have I output signal that is constantly
> sending (beacon) and one that is only sending sometimes, however the
> interleaving of output signals means that both streams needs to be
> constantly sending.
>

Right, the add block needs to see items from both streams so that it can add
them together. If there is no data on one stream, there is nothing to add
and it does not assume zeros.

My advice is to make a new block. The easiest would probably to make a new
add block that inherits from gr_block instead of gr_sync_block. In this
block, you tests the length of both inputs and add which items together that
you want, substituting zeros when there is no more data on the incoming
message stream. It will be pretty specific to your needs, and be careful
with your consume() and return item numbers to account for what you've done
with both streams.

Tom
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to