On Mon, Jul 21, 2008 at 02:23:55AM -0700, irene159 wrote:
> 
> Eric Blossom wrote:
> > 
> > On Fri, Jul 18, 2008 at 03:19:08PM -0700, irene159 wrote:
> >> 
> >> Hi,
> >> 
> >> I have the same problem. I have already taken a look at gr_simple_framer,
> >> but code seems slightly complicated. I would appreciate any
> >> explanations/comments on how to code different input and output rates.
> >> 
> >> In the block I am coding the number of input items for an output item
> >> isn't
> >> constant. How can I handle this?
> >> 
> >> Thanks,
> >> 
> >> Irene
> > 
> > All is revealed in:
> > 
> >   http://www.gnu.org/software/gnuradio/doc/howto-write-a-block.html
> > 
> > Basically you subclass gr_block, provide forecast and general_work
> > methods, then call consume/consume_each at the tail end of your
> > general_work function.
> > 
> > Eric
>
> 
> Thanks, I think I am starting to figure thinks out.
> 
> When referring to gr_simple_framer (which I am using as an example), may you
> please help me understand the processing part (lines 76 to 89 in the .cc
> file)?
> 
> So, we are adding a synchro sequence at the beginning of a frame of
> ‘payload_bytesize’ bytes. I suppose lines 79 to 87 in the while loop add the
> synchro sequence end the sequence number. Line 89 copies ‘payload_bytesize’
> bytes of input data to output stream after de synchro sequence. But why
> write 0x55 ‘noutput_items’ bytes to ‘out’ ? 

This could be cleaned up.  It provides the tail padding (and at one
time in the development, there was also a 0x55 preamble, and this
handled it).  We eventually moved on and changed how we handled the
creation of the framing.  It's now done in python.  See pkt.py.

Eric


_______________________________________________
Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to