Change number of input bytes in block

Hi,

i’ve a _bb block that i wrote. On the first call to work() i
get 2047 bytes, 2nd call 127, then 7 and then 1 byte …then the
whole thing starts again.

I would like to get the same amount of data for each call to
work() (e.g. always 512 bytes on input). Is that possible?

Where does 2047, 127, 7 and 1 come from anyway?
(2^11 - 1, 2^7 -1, 2^3 - 1, 2^1 - 1)

steve

steve wrote:

Hi,

i’ve a _bb block that i wrote. On the first call to work() i
get 2047 bytes, 2nd call 127, then 7 and then 1 byte …then the
whole thing starts again.

The scheduler will basically give you every input sample it has
available.

I would like to get the same amount of data for each call to
work() (e.g. always 512 bytes on input). Is that possible?

You can ensure that you always get AT LEAST AS MANY input items as you
need by making your own forecast() method. If more data is available,
you will get more, but you don’t need to consume all of it. Look at
some of the blocks that inherit from gr_block instead of gr_sync_block.

Where does 2047, 127, 7 and 1 come from anyway?
(2^11 - 1, 2^7 -1, 2^3 - 1, 2^1 - 1)

Buffer sizes tend to be in multiples of a page.

Matt

On Fri, Mar 09, 2007 at 04:18:29PM +0000, steve wrote:

(2^11 - 1, 2^7 -1, 2^3 - 1, 2^1 - 1)

steve

What base class does your _bb block derive from?

Eric