Hello everyone:
I am now construction a flow graph whose function is scramble the data
frame. And the scramble seed changes after sending each frame, the
structure is as follows(some parts are omitted ):
class my_top_block(gr.top_block)
def __init(self):
gr.top_block.init(self)
self.source = gr.message_source(**)
self.scramble0 = scramble(scrambleseed = 0)
self.scramble1 = scramble(scrambleseed = 1)
self.sink = gr.file_sink(gr.sizeof_char, file)
self.connect(self.source,self.scramble0)
self.connect(self.scramble0,self.sink)
def reconf0(self):
self.disconnect(self.source,self.scramble0)
self.disconnect(self.scramble0,self.sink)
self.connect(self.source,self.scramble1)
self.connect(self.scramble1,self.sink)
def reconf1(self):
self.disconnect(self.source,self.scramble1)
self.disconnect(self.scramble1,self.sink)
self.connect(self.source,self.scramble0)
self.connect(self.scramble0,self.sink)
def main
def send_pkt(data)
if eof:
msg = gr.message(1)
else:
msg = gr.message_from_string(data)
tb.source.msgq().insert_tail(msg)
tb = my_top_block()
tb.start()
n = 0
while n<10
data = ** #the data frame
send_pkt(data)
tb.lock
if(n%2 ==0):
tb.reconf0()
else:
tb.reconf1()
tb.unlock
n=n+1
send_pkt(eof=True)
tb.wait
if name == ‘main’
try:
main()
except KeyboardInterrupt
pass
##########################################################################
however, it seems that the flow graph isn’t reconfigured as every frame
passes into the flow graph. Instead, all the frames are scrambled by the
block scramble0.
What should I do to realize this function?
Thanks for your help
Catherine Kwan