def test_msg_strobe(self): print("\n=== Test 1, with GNU Radio message_strobe\n") tst_msg = "--- FROM message strobe TO msg_sink" src = blocks.message_strobe(pmt.intern(tst_msg), 1000) blk_sink = msg_sink() self.tb.msg_connect((src, "strobe"), (blk_sink, blk_sink.ports_in[0].port)) #self.tb.run() # for flowgraphs that will stop on its own! self.tb.start() time.sleep(5) self.tb.stop() self.tb.wait() return
def test_msg_source(self): print("\n=== Test 2, with GWN msg_source\n") tst_msg = "--- FROM message source TO msg_sink" blk_src = msg_source(msg_count=4, interval=1.0) blk_sink = msg_sink() self.tb.msg_connect((blk_src, blk_src.ports_out[0].port), (blk_sink, blk_sink.ports_in[0].port)) #self.tb.run() # for flowgraphs that will stop on its own! self.tb.start() time.sleep(5) self.tb.stop() self.tb.wait() return
def test_msg_passer(self): print "\n=== Test message passing, interrupt, continue\n" blk_src = msg_source(msg_count=12, interval=1.0) blk_src.timers[0].debug = False # True blk_pass = msg_passer(tout_stop=4.0, tout_restart=7.0) blk_sink = msg_sink() self.tb.msg_connect((blk_src, blk_src.ports_out[0].port), (blk_pass, blk_pass.ports_in[0].port)) self.tb.msg_connect((blk_pass, blk_pass.ports_out[0].port), (blk_sink, blk_sink.ports_in[0].port)) #self.tb.run() # for flowgraphs that will stop on its own! self.tb.start() time.sleep(14) self.tb.stop() self.tb.wait() return