""" Embedded Python Blocks: Each this file is saved, GRC will instantiate the first class it finds to get ports and parameters of your block. The arguments to __init__ will be the parameters. All of them are required to have default values! """ import numpy as np import sys from gnuradio import gr class blk(gr.sync_block): def __init__(self, enabler=False): # only default arguments here gr.sync_block.__init__( self, name='Embedded Python Block', in_sig=[np.float32], out_sig=[np.float32] ) self.enabler = enabler def work(self, input_items, output_items): key = sys.stdin.read(1) if key==' ': self.enabler=True if self.enabler == True: output_items[0][:] = input_items[0] return len(output_items[0]) """Created by Abdul Samad Usman"""