Sure, no problem, use a gr::block. Just call consume() to tell the scheduler how many items you consumed, and return the number of samples you produced -- subject to the size of the output buffer. general_work() gets the size of your input and output buffers from ninput_items and noutput_items. Perfectly fine to return a smaller value than requested.
Nick
On Wed, Mar 6, 2019 at 5:43 PM Mark Gannet <mgannet@gmail.com> wrote:
Is it possible to write a custom block that only copies items to the output buffer if they meet a certain criterion? I'm thinking of something like a "keep m of n" block but where there is no knowledge of the number of items that will be written to the output buffer when entering the work function._______________________________________________Thanks,Mark
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
No comments:
Post a Comment