Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from gnuradio import gr
- import numpy
- class stream_crc(gr.basic_block):
- " Stream CRC"
- def __init__(self, packetLength, lengthTagKey):
- gr.basic_block.__init__(
- self,
- name="stream_crc",
- in_sig=[numpy.byte],
- out_sig=[numpy.byte]
- )
- self.packetLength = packetLength
- def general_work(self, input_items, output_items):
- print 'general_work'
- print input_items
- output_items[0] = input_items[0]
- print '>>', type(output_items[0]), type(input_items[0])
- print 'len(output_items[0]) = '+str(len(output_items[0]))+' len(input_items[0]) = '+str(len(input_items[0]))
- print "output: ", output_items
- print output_items
- print '#######'
- return len(output_items[0])
- def forecast(self, noutput_items, ninput_items_required):
- """
- forecast is only called from a general block
- this is the default implementation
- """
- ninput_items_required[0] = noutput_items
- print "Forecast:\n noutput_items: "
- print noutput_items
- print "ninput_items_required: "
- print ninput_items_required[0]
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement