def __init__(self,options): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) #CHAN #gras.TopBlock.__init__(self, "test_fhss_block") #CHANGE ME self.cog_phy_0=phy.cog_phy(options.args) # dest_addt,source_addr,max_attempts,time_out '''self.fhss_tx_0=fhss_tx.fhss_engine_tx(options.dest_addr,options.source_addr,"989.6e6,990e6,990.4e6" ,7,0.05,1,0.05,2000,options.args,options.args)''' self.fhss_rx_0=fhss_rx.fhss_engine_rx(options.dest_addr,options.source_addr,"989.6e6,990e6,990.4e6" ,3,self.cog_phy_0.uhd_usrp_source,self.cog_phy_0.uhd_usrp_sink) self.wake_up=heart_beat.heart_beat("check","wake_up",0.01) self.gr_file_sink_0 = gr.file_sink(gr.sizeof_char*1, options.output_file) self.gr_file_sink_0.set_unbuffered(True) self.extras_stream_to_datagram_0 = grextras.Stream2Datagram(1, options.pkt_size) self.extras_datagram_to_stream_0 = grextras.Datagram2Stream(1) ################################################## # Connections ################################################## #self.connect((self.gr_file_source_0, 0), (self.extras_stream_to_datagram_0, 0)) #self.connect((self.extras_stream_to_datagram_0,0),(self.fhss_rx_0,1)) self.connect((self.cog_phy_0,0),(self.fhss_rx_0,0)) self.connect((self.fhss_rx_0,0),(self.cog_phy_0,0)) self.connect((self.fhss_rx_0,1),(self.extras_datagram_to_stream_0,0)) self.connect((self.extras_datagram_to_stream_0,0),(self.gr_file_sink_0,0)) #self.connect((self.cog_phy_0,1),(self.wxgui_fftsink2_0,0)) self.connect((self.wake_up,0),(self.fhss_rx_0,2))
def __init__(self,options): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) #CHANGE ME self.cog_phy_0=phy.cog_phy(options.args) self.mac_0=csma_macaw_rx.csma_mac(options.dest_addr,options.source_addr,0.001,1) self.wake_up=heart_beat.heart_beat("check","wake_up",0.001) #CHANGE ME self.gr_file_sink_0 = gr.file_sink(gr.sizeof_char*1, options.output_file) self.gr_file_sink_0.set_unbuffered(True) self.extras_datagram_to_stream_0 = grextras.Datagram2Stream(1) ################################################## # Connections ################################################## self.connect((self.cog_phy_0,0),(self.mac_0,0)) self.connect((self.mac_0,0),(self.cog_phy_0,0)) self.connect((self.mac_0,1),(self.extras_datagram_to_stream_0,0)) self.connect((self.extras_datagram_to_stream_0,0),(self.gr_file_sink_0,0)) self.connect((self.wake_up,0),(self.mac_0,2))
def __init__(self,options): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) #CHANGE ME self.cog_phy_0=phy.cog_phy(options.args) # dest_addt,source_addr,max_attempts,time_out #self.probe_0=probe.probe(0,1) self.probe_0=gr.probe_avg_mag_sqrd_c(-30) #self.ss_chain_0=spectrum_sense.pwrfft_c(200e3,1024,25,) self.mac_0=csma.csma_mac(options.dest_addr,options.source_addr,options.max_attempts,options.time_out,0.05,0.0001,10000,self.probe_0,1e-6) self.wake_up=heart_beat.heart_beat("check","wake_up",0.001) #CHANGE ME print options.input_file self.gr_file_source_0 = gr.file_source(gr.sizeof_char*1,options.input_file, True) #CHANGE ME self.gr_file_sink_0 = gr.file_sink(gr.sizeof_char*1, options.output_file) self.gr_file_sink_0.set_unbuffered(True) self.extras_stream_to_datagram_0 = grextras.Stream2Datagram(1, options.pkt_size) self.extras_datagram_to_stream_0 = grextras.Datagram2Stream(1) self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=990e6, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=1e6, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot of source usrp", peak_hold=True, ) #self.Add(self.wxgui_fftsink2_0.win) #self.tags_d_0=tags_demo.tags_demo() #self.extras_stream_to_datagram_1 = grextras.Stream2Datagram(1, 256) #self.extras_datagram_to_stream_1 = grextras.Datagram2Stream(1) ################################################## # Connections ################################################## self.connect((self.gr_file_source_0, 0), (self.extras_stream_to_datagram_0, 0)) self.connect((self.extras_stream_to_datagram_0,0),(self.mac_0,1)) self.connect((self.cog_phy_0,0),(self.mac_0,0)) self.connect((self.mac_0,0),(self.cog_phy_0,0)) self.connect((self.mac_0,1),(self.extras_datagram_to_stream_0,0)) self.connect((self.extras_datagram_to_stream_0,0),(self.gr_file_sink_0,0)) #self.connect((self.cog_phy_0,1),(self.wxgui_fftsink2_0,0)) self.connect((self.wake_up,0),(self.mac_0,2)) #self.connect((self.cog_phy_0,1),(self.mac_0,3)) self.connect((self.cog_phy_0,1),(self.probe_0,0)) """self.connect((self.gr_file_source_1, 0), (self.extras_stream_to_datagram_1, 0))
def __init__(self, options): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) #CHANGE ME self.cog_phy_0 = phy.cog_phy(options.args) self.probe_0 = gr.probe_avg_mag_sqrd_c(30, 0.001) # dest_addt,source_addr,max_attempts,time_out self.mac_0 = new_split_tx.split_demo(options.dest_addr, options.source_addr, options.time_out, options.lower_H, options.higher_H, self.probe_0, 1e-3) #self.mac_0=split.split_demo(options.dest_addr,options.source_addr,options.time_out,options.lower_H,options.higher_H,self.probe_0,1e-8) self.wake_up = heart_beat.heart_beat("check", "wake_up", 0.01) #CHANGE ME self.gr_file_source_0 = gr.file_source(gr.sizeof_char * 1, options.input_file, True) #CHANGE ME self.gr_file_sink_0 = gr.file_sink(gr.sizeof_char * 1, options.output_file) self.gr_file_sink_0.set_unbuffered(True) self.extras_stream_to_datagram_0 = grextras.Stream2Datagram( 1, options.pkt_size) self.extras_datagram_to_stream_0 = grextras.Datagram2Stream(1) #self.tags_d_0=tags_demo.tags_demo() #self.extras_stream_to_datagram_1 = grextras.Stream2Datagram(1, 256) #self.extras_datagram_to_stream_1 = grextras.Datagram2Stream(1) ################################################## # Connections ################################################## self.connect((self.gr_file_source_0, 0), (self.extras_stream_to_datagram_0, 0)) self.connect((self.extras_stream_to_datagram_0, 0), (self.mac_0, 1)) self.connect((self.cog_phy_0, 0), (self.mac_0, 0)) self.connect((self.mac_0, 0), (self.cog_phy_0, 0)) self.connect((self.mac_0, 1), (self.extras_datagram_to_stream_0, 0)) self.connect((self.extras_datagram_to_stream_0, 0), (self.gr_file_sink_0, 0)) #self.connect((self.cog_phy_0,1),(self.wxgui_fftsink2_0,0)) self.connect((self.wake_up, 0), (self.mac_0, 2)) self.connect((self.cog_phy_0, 1), (self.probe_0, 0)) #self.connect((self.cog_phy_0,2),(self.wxgui_fftsink2_0,0)) #self.connect((self.cog_phy_0,1),(self.mac_0,3)) #self.connect((self.cog_phy_0,1),(self.tags_d_0,0)) """self.connect((self.gr_file_source_1, 0), (self.extras_stream_to_datagram_1, 0))
def __init__(self,options): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) #CHANGE ME self.cog_phy_0=phy.cog_phy(options.args) # dest_addt,source_addr,max_attempts,time_out self.probe_0=gr.probe_avg_mag_sqrd_c(30,0.001) self.mac_0=new_split_rcv.pilot_rcv(options.dest_addr,options.source_addr,self.probe_0,0.05) self.wake_up=heart_beat.heart_beat("check","wake_up",0.01) #CHANGE ME self.gr_file_source_0 = gr.file_source(gr.sizeof_char*1, options.input_file, True) #CHANGE ME self.gr_file_sink_0 = gr.file_sink(gr.sizeof_char*1, options.output_file) self.gr_file_sink_0.set_unbuffered(True) self.extras_stream_to_datagram_0 = grextras.Stream2Datagram(1, options.pkt_size) self.extras_datagram_to_stream_0 = grextras.Datagram2Stream(1) #self.tags_d_0=tags_demo.tags_demo() #self.extras_stream_to_datagram_1 = grextras.Stream2Datagram(1, 256) #self.extras_datagram_to_stream_1 = grextras.Datagram2Stream(1) ################################################## # Connections ################################################## self.connect((self.gr_file_source_0, 0), (self.extras_stream_to_datagram_0, 0)) self.connect((self.extras_stream_to_datagram_0,0),(self.mac_0,1)) self.connect((self.cog_phy_0,0),(self.mac_0,0)) self.connect((self.mac_0,0),(self.cog_phy_0,0)) self.connect((self.mac_0,1),(self.extras_datagram_to_stream_0,0)) self.connect((self.extras_datagram_to_stream_0,0),(self.gr_file_sink_0,0)) #self.connect((self.cog_phy_0,1),(self.wxgui_fftsink2_0,0)) self.connect((self.wake_up,0),(self.mac_0,2)) self.connect((self.cog_phy_0,1),(self.probe_0,0)) #self.connect((self.cog_phy_0,2),(self.wxgui_fftsink2_0,0)) #self.connect((self.cog_phy_0,1),(self.mac_0,3)) #self.connect((self.cog_phy_0,1),(self.tags_d_0,0)) """self.connect((self.gr_file_source_1, 0), (self.extras_stream_to_datagram_1, 0))
def __init__(self,options): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) #sensing chain self.cs_0=spectrum_sense.pwrfft_c(options.sample_rate,options.fft_size, options.sample_rate/(options.fft_size*8),1,False) self.probe_0=fft_probe.probe(options.fft_size,options.sense_band,options.sample_rate,"977e6,978.5e6,980e6,981.5e6,983e6",options.freq) # self.cog_phy_0=phy.cog_phy(options.args,options.sense_band,options.sample_rate,options.freq) # dest_addt,source_addr,max_attempts,time_out '''self.fhss_tx_0=fhss_tx.fhss_engine_tx(options.dest_addr,options.source_addr,"977e6,978.5e6,980e6,981.5e6,983e6" ,7,0.05,1,0.05,2000,options.args,options.args)''' self.fhss_tx_0=fhss_tx_cs.fhss_engine_tx(options.dest_addr,options.source_addr,"977e6,978.5e6,980e6,981.5e6,983e6" ,3,0.5,0.005,0.05,2000,self.cog_phy_0.uhd_usrp_source,self.cog_phy_0.uhd_usrp_sink,self.probe_0) self.wake_up=heart_beat.heart_beat("check","wake_up",0.01) self.gr_file_source_0 = gr.file_source(gr.sizeof_char*1, options.input_file, True) self.gr_file_sink_0 = gr.file_sink(gr.sizeof_char*1, options.output_file) self.gr_file_sink_0.set_unbuffered(True) self.extras_stream_to_datagram_0 = grextras.Stream2Datagram(1, options.pkt_size) self.extras_datagram_to_stream_0 = grextras.Datagram2Stream(1) ################################################## # Connections ################################################## self.connect((self.gr_file_source_0, 0), (self.extras_stream_to_datagram_0, 0)) self.connect((self.extras_stream_to_datagram_0,0),(self.fhss_tx_0,1)) self.connect((self.cog_phy_0,0),(self.fhss_tx_0,0)) self.connect((self.fhss_tx_0,0),(self.cog_phy_0,0)) self.connect((self.fhss_tx_0,1),(self.extras_datagram_to_stream_0,0)) self.connect((self.extras_datagram_to_stream_0,0),(self.gr_file_sink_0,0)) #self.connect((self.cog_phy_0,1),(self.wxgui_fftsink2_0,0)) self.connect((self.wake_up,0),(self.fhss_tx_0,2)) self.connect((self.cog_phy_0,1),(self.cs_0,0)) self.connect((self.cs_0,0),(self.probe_0,0))
def __init__(self): grc_wxgui.top_block_gui.__init__(self, title="Top Block") _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) #CHANGE ME self.cog_phy=phy.cog_phy("addr=10.32.19.156") #CHANGE ME self.gr_file_source_0 = gr.file_source(gr.sizeof_char*1, "/home/electron/project/cog-mac/testfile1", True) self.gr_file_sink_0 = gr.file_sink(gr.sizeof_char*1, "/home/electron/project/cog-mac/testOutput") self.gr_file_sink_0.set_unbuffered(True) self.extras_stream_to_datagram_0 = grextras.Stream2Datagram(1, 256) self.extras_datagram_to_stream_0 = grextras.Datagram2Stream(1) self.wxgui_fftsink2_0 = fftsink2.fft_sink_c( self.GetWin(), baseband_freq=990e6, y_per_div=10, y_divs=10, ref_level=0, ref_scale=2.0, sample_rate=1e6, fft_size=1024, fft_rate=15, average=False, avg_alpha=None, title="FFT Plot", peak_hold=True, ) #self.Add(self.wxgui_fftsink2_0.win) ################################################## # Connections ################################################## self.connect((self.gr_file_source_0, 0), (self.extras_stream_to_datagram_0, 0)) self.connect((self.extras_stream_to_datagram_0,0),(self.cog_phy,0)) self.connect((self.cog_phy,0),(self.extras_datagram_to_stream_0,0)) self.connect((self.extras_datagram_to_stream_0,0),(self.gr_file_sink_0,0))