discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: Clearing a Blocks Buffers


From: Jeff Long
Subject: Re: Clearing a Blocks Buffers
Date: Wed, 31 May 2023 13:01:47 -0400

No, there is not currently a way of flushing all or part of a flowgraph.

On Wed, May 31, 2023 at 9:58 AM Luke Berndt <luke@robotastic.com> wrote:
Is there a good method for clearing or resetting a block’s buffers? 

I have a program that tunes to different frequencies and is also started & paused. I want to clear out any of the existing samples in the buffers between blocks to make sure I am getting the current signal in and not something that was left over. 

I have tried the following approach but it sometimes leads to segfaults with some blocks.  Can this be done? Is there a better way to do this or achieve the same results?

gr::block_detail_sptr detail;
gr::block_sptr grblock = cast_to_block_sptr(block);
detail = grblock->detail();
detail->reset_nitem_counters();

reply via email to

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