def __init__(self): gr.top_block.__init__(self, "four_way_handshake_csma") Qt.QWidget.__init__(self) self.setWindowTitle("four_way_handshake_csma") qtgui.util.check_set_qss() try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "four_way_handshake_csma") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.sps = sps = 4 self.range_rx_gain = range_rx_gain = 0 self.range_mu = range_mu = 0.6 self.usrp_device_address = usrp_device_address = "addr=10.0.0.6" self.tx_center_frequency = tx_center_frequency = 4.2e8 self.system_time_granularity_us = system_time_granularity_us = 10 self.source_address = source_address = 1 self.samp_rate = samp_rate = 1000000 self.rx_gain = rx_gain = range_rx_gain self.rx_center_frequency = rx_center_frequency = 4.2e8 self.rrc = rrc = firdes.root_raised_cosine(1.0, sps, 1, 0.5, 11 * sps) self.padding = padding = 64 self.mu = mu = range_mu self.diff_preamble_128 = diff_preamble_128 = [ 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0 ][0:128] self.destination_address = destination_address = 2 self.cs_threshold = cs_threshold = 0.005 ################################################## # Blocks ################################################## self._range_rx_gain_range = Range(0, 60, 1, 0, 200) self._range_rx_gain_win = RangeWidget(self._range_rx_gain_range, self.set_range_rx_gain, 'Rx Gain', "counter_slider", float) self.top_grid_layout.addWidget(self._range_rx_gain_win, 1, 0, 1, 1) self._range_mu_range = Range(0, 1, 0.01, 0.6, 200) self._range_mu_win = RangeWidget(self._range_mu_range, self.set_range_mu, 'BB Derotation Gain', "counter_slider", float) self.top_grid_layout.addWidget(self._range_mu_win, 2, 0, 1, 1) self.inets_timeout_0_0 = inets.timeout(0, 10, 100, 1000, 0) self.inets_timeout_0 = inets.timeout(0, 40, 100, 1000, 0) self.inets_sending_0 = inets.sending( develop_mode=0, block_id=11, constellation=gnuradio.digital.constellation_qpsk().base(), preamble=diff_preamble_128, samp_rate=samp_rate, sps=sps, system_time_granularity_us=system_time_granularity_us, usrp_device_address=usrp_device_address, center_frequency=tx_center_frequency, interframe_interval_s=0.01, t_pretx_interval_s=0.003) self.inets_rts_framing_0 = inets.rts_framing( 0, 30, 1, 1, destination_address, 1, source_address, 1, 318, 2, 524, 2, 2, 1, 3, padding, diff_preamble_128, gnuradio.digital.constellation_qpsk().bits_per_symbol() * (samp_rate / sps), 1000, 800) self.inets_resend_check_0_0 = inets.resend_check(0, 24, 6) self.inets_resend_check_0 = inets.resend_check(0, 24, 6) self.inets_receiving_0 = inets.receiving( 1, 21, gnuradio.digital.constellation_qpsk().base(), rrc, mu, diff_preamble_128, rx_gain, samp_rate, sps, 30, usrp_device_address, rx_center_frequency) self.inets_general_timer_0 = inets.general_timer(0, 3, 0, 5000, 10, 0) self.inets_framing_1 = inets.framing(0, 17, 2, 1, 0, 1, destination_address, 1, source_address, 1, 318, 2, 524, 2, 2, 1, 1, 0, ([2, 3]), ([1000, 1000]), 2) self.inets_framing_0 = inets.framing(0, 17, 1, 1, 0, 1, destination_address, 1, source_address, 1, 318, 2, 524, 2, 2, 1, 1, 0, ([2, 3]), ([1000, 1000]), 2) self.inets_frame_type_check_0_0_1 = inets.frame_type_check( 0, 25, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1) self.inets_frame_type_check_0_0_0 = inets.frame_type_check( 1, 25, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1) self.inets_frame_type_check_0_0 = inets.frame_type_check( 0, 25, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1) self.inets_frame_buffer_0 = inets.frame_buffer(0, 16, 10, 1, 1) self.inets_frame_analysis_0 = inets.frame_analysis( 0, 7, 1, 1, 1, 1, 1, 2, 2, 2, 1, source_address) self.inets_dummy_source_0 = inets.dummy_source(0, 23, 100, 1, 1) self.inets_cts_framing_0 = inets.cts_framing( 0, 31, 1, 1, destination_address, 1, source_address, 1, 318, 2, 524, 2, 2, 1, 3, padding, diff_preamble_128, gnuradio.digital.constellation_qpsk().bits_per_symbol() * (samp_rate / sps), 1000, 800) self.inets_counter_1_0 = inets.counter(1, 100, 1) self.inets_counter_0 = inets.counter(1, 100, 0) self.inets_backoff_0 = inets.backoff(0, 11, 1, 10, 100, 400, 0, 0.005, 10, 0) self.inets_address_check_0_1 = inets.address_check( 0, 17, source_address) self.inets_address_check_0_0_0 = inets.address_check( 0, 17, source_address) self.inets_address_check_0_0 = inets.address_check( 0, 17, source_address) self.inets_address_check_0 = inets.address_check(0, 17, source_address) self.inets_IFS_0_0 = inets.IFS(0, 19, 1000, 800, 1, 0, 1, cs_threshold, system_time_granularity_us) self.inets_IFS_0 = inets.IFS(0, 19, 1000, 800, 3, 0, 1, cs_threshold, system_time_granularity_us) self.blocks_message_strobe_0 = blocks.message_strobe( pmt.intern("TEST"), 1000) ################################################## # Connections ################################################## self.msg_connect((self.blocks_message_strobe_0, 'strobe'), (self.inets_dummy_source_0, 'trigger')) self.msg_connect((self.blocks_message_strobe_0, 'strobe'), (self.inets_general_timer_0, 'active_in')) self.msg_connect((self.inets_IFS_0, 'frame_info_fail_out'), (self.inets_backoff_0, 'frame_info_in')) self.msg_connect((self.inets_IFS_0, 'frame_info_pass_out'), (self.inets_sending_0, 'in')) self.msg_connect((self.inets_IFS_0_0, 'frame_info_pass_out'), (self.inets_sending_0, 'in')) self.msg_connect( (self.inets_address_check_0, 'address_check_pass_out'), (self.inets_framing_1, 'data_in')) self.msg_connect( (self.inets_address_check_0_0, 'address_check_fail_out'), (self.inets_backoff_0, 'virtual_cs_frame_in')) self.msg_connect( (self.inets_address_check_0_0, 'address_check_pass_out'), (self.inets_cts_framing_0, 'rts_frame_info_in')) self.msg_connect( (self.inets_address_check_0_0_0, 'address_check_fail_out'), (self.inets_backoff_0, 'frame_info_in')) self.msg_connect( (self.inets_address_check_0_0_0, 'address_check_pass_out'), (self.inets_timeout_0, 'cts_frame_info_in')) self.msg_connect( (self.inets_address_check_0_1, 'address_check_pass_out'), (self.inets_timeout_0_0, 'ack_frame_info_in')) self.msg_connect((self.inets_backoff_0, 'frame_info_out'), (self.inets_resend_check_0, 'frame_info_in')) self.msg_connect((self.inets_cts_framing_0, 'frame_out'), (self.inets_IFS_0_0, 'frame_in')) self.msg_connect((self.inets_dummy_source_0, 'output'), (self.inets_framing_0, 'data_in')) self.msg_connect((self.inets_frame_analysis_0, 'frame_info_out'), (self.inets_frame_type_check_0_0_0, 'frame_info_in')) self.msg_connect((self.inets_frame_buffer_0, 'dequeue_element'), (self.inets_rts_framing_0, 'data_frame_in')) self.msg_connect( (self.inets_frame_type_check_0_0, 'rts_frame_info_out'), (self.inets_backoff_0, 'frame_info_in')) self.msg_connect( (self.inets_frame_type_check_0_0, 'cts_frame_info_out'), (self.inets_rts_framing_0, 'cts_frame_in')) self.msg_connect( (self.inets_frame_type_check_0_0_0, 'data_frame_info_out'), (self.inets_address_check_0, 'frame_info_in')) self.msg_connect( (self.inets_frame_type_check_0_0_0, 'rts_frame_info_out'), (self.inets_address_check_0_0, 'frame_info_in')) self.msg_connect( (self.inets_frame_type_check_0_0_0, 'cts_frame_info_out'), (self.inets_address_check_0_0_0, 'frame_info_in')) self.msg_connect( (self.inets_frame_type_check_0_0_0, 'ack_frame_info_out'), (self.inets_address_check_0_1, 'frame_info_in')) self.msg_connect( (self.inets_frame_type_check_0_0_1, 'ack_frame_info_out'), (self.inets_counter_0, 'message_in')) self.msg_connect( (self.inets_frame_type_check_0_0_1, 'ack_frame_info_out'), (self.inets_frame_buffer_0, 'dequeue')) self.msg_connect( (self.inets_frame_type_check_0_0_1, 'data_frame_info_out'), (self.inets_resend_check_0_0, 'frame_info_in')) self.msg_connect((self.inets_framing_0, 'frame_out'), (self.inets_frame_buffer_0, 'enqueue')) self.msg_connect((self.inets_framing_1, 'frame_out'), (self.inets_IFS_0_0, 'frame_in')) self.msg_connect((self.inets_general_timer_0, 'expire_signal_out'), (self.inets_counter_0, 'stop_counter_in')) self.msg_connect((self.inets_receiving_0, 'rx_power_out'), (self.inets_IFS_0, 'frame_in')) self.msg_connect((self.inets_receiving_0, 'rx_power_out'), (self.inets_IFS_0_0, 'frame_in')) self.msg_connect((self.inets_receiving_0, 'rx_power_out'), (self.inets_backoff_0, 'power_in')) self.msg_connect((self.inets_receiving_0, 'rx_frame_out'), (self.inets_frame_analysis_0, 'frame_in')) self.msg_connect((self.inets_resend_check_0, 'resend_check_pass_out'), (self.inets_IFS_0, 'frame_in')) self.msg_connect((self.inets_resend_check_0, 'resend_check_fail_out'), (self.inets_frame_buffer_0, 'dequeue')) self.msg_connect( (self.inets_resend_check_0_0, 'resend_check_fail_out'), (self.inets_frame_buffer_0, 'dequeue')) self.msg_connect( (self.inets_resend_check_0_0, 'resend_check_pass_out'), (self.inets_rts_framing_0, 'cts_frame_in')) self.msg_connect((self.inets_rts_framing_0, 'frame_out'), (self.inets_IFS_0, 'frame_in')) self.msg_connect((self.inets_sending_0, 'rts_frame_out'), (self.inets_timeout_0, 'rts_frame_info_in')) self.msg_connect((self.inets_sending_0, 'data_frame_out'), (self.inets_timeout_0_0, 'data_frame_info_in')) self.msg_connect((self.inets_timeout_0, 'frame_info_out'), (self.inets_frame_type_check_0_0, 'frame_info_in')) self.msg_connect((self.inets_timeout_0_0, 'frame_info_out'), (self.inets_frame_type_check_0_0_1, 'frame_info_in'))
def __init__(self): gr.top_block.__init__(self, "Test_standard_tdma_center") Qt.QWidget.__init__(self) self.setWindowTitle("Test_standard_tdma_center") qtgui.util.check_set_qss() try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "Test_standard_tdma_center") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.sps = sps = 4 self.range_rx_gain = range_rx_gain = 0 self.range_mu = range_mu = 0.6 self.usrp_device_address = usrp_device_address = "addr=10.0.0.6" self.tx_center_frequency = tx_center_frequency = 3.9e8 self.timeout_duration_ms = timeout_duration_ms = 500 self.system_time_granularity_us = system_time_granularity_us = 10 self.source_address = source_address = 1 self.samp_rate = samp_rate = 1000000 self.rx_gain = rx_gain = range_rx_gain self.rx_center_frequency = rx_center_frequency = 3.9e8 self.rrc = rrc = firdes.root_raised_cosine(1.0, sps, 1, 0.5, 11*sps) self.mu = mu = range_mu self.diff_preamble_128 = diff_preamble_128 = [1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0,0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0,0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1,1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0][0:128] self.destination_address = destination_address = 2 self.cs_threshold = cs_threshold = 0.005 ################################################## # Blocks ################################################## self._range_rx_gain_range = Range(0, 60, 1, 0, 200) self._range_rx_gain_win = RangeWidget(self._range_rx_gain_range, self.set_range_rx_gain, 'Rx Gain', "counter_slider", float) self.top_grid_layout.addWidget(self._range_rx_gain_win, 1,0,1,1) self._range_mu_range = Range(0, 1, 0.01, 0.6, 200) self._range_mu_win = RangeWidget(self._range_mu_range, self.set_range_mu, 'BB Derotation Gain', "counter_slider", float) self.top_grid_layout.addWidget(self._range_mu_win, 2,0,1,1) self.inets_sending_0 = inets.sending(develop_mode=0, block_id=11, constellation=gnuradio.digital.constellation_qpsk().base(), preamble=diff_preamble_128, samp_rate=samp_rate, sps=sps, system_time_granularity_us=system_time_granularity_us, usrp_device_address=usrp_device_address, center_frequency=tx_center_frequency) self.inets_framing_0_0 = inets.framing(0, 17, 1, 1, 0, 1, destination_address, 1, source_address, 1, 318, 2, 524, 2, 2, 1, 1, 0, ([2, 3]), ([1000, 1000]), 2) self.inets_framing_0 = inets.framing(0, 17, 2, 1, 0, 1, destination_address, 1, source_address, 1, 318, 2, 524, 2, 2, 1, 1, 0, ([2, 3]), ([1000, 1000]), 2) self.inets_frame_type_check_0 = inets.frame_type_check(0, 25, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1) self.inets_frame_probe_0_0 = inets.frame_probe(1, 101, 0) self.inets_frame_probe_0 = inets.frame_probe(0, 100, 0) self.inets_frame_analysis_0 = inets.frame_analysis(0, 7, 1, 1, 1, 1, 1, 2, 2, 2, 1, 2) self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_SERVER", 'localhost', '52001', 10000, False) ################################################## # Connections ################################################## self.msg_connect((self.blocks_socket_pdu_0, 'pdus'), (self.inets_framing_0_0, 'data_in')) self.msg_connect((self.inets_frame_analysis_0, 'frame_info_out'), (self.inets_frame_type_check_0, 'frame_info_in')) self.msg_connect((self.inets_frame_type_check_0, 'data_frame_info_out'), (self.inets_framing_0, 'data_in')) self.msg_connect((self.inets_framing_0, 'frame_out'), (self.inets_sending_0, 'in')) self.msg_connect((self.inets_framing_0_0, 'frame_pmt_out'), (self.inets_frame_analysis_0, 'frame_in')) self.msg_connect((self.inets_sending_0, 'ack_frame_out'), (self.inets_frame_probe_0, 'info_in')) self.msg_connect((self.inets_sending_0, 'data_frame_out'), (self.inets_frame_probe_0_0, 'info_in'))
def __init__(self): gr.top_block.__init__(self, "csma_rtscts_80211_II") Qt.QWidget.__init__(self) self.setWindowTitle("csma_rtscts_80211_II") qtgui.util.check_set_qss() try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "csma_rtscts_80211_II") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.sps = sps = 4 self.usrp_device_address = usrp_device_address = "addr=10.0.0.20" self.tx_center_frequency = tx_center_frequency = 3.9e8 self.timeout_duration_ms = timeout_duration_ms = 1000 self.system_time_granularity_us = system_time_granularity_us = 10 self.source_address = source_address = 3 self.samp_rate = samp_rate = 400000 self.rx_gain = rx_gain = 0 self.rx_center_frequency = rx_center_frequency = 3.9e8 self.rrc = rrc = firdes.root_raised_cosine(1.0, sps, 1, 0.5, 11 * sps) self.padding = padding = 64 self.mu = mu = 0.6 self.diff_preamble_128 = diff_preamble_128 = [ 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0 ][0:128] self.destination_address = destination_address = 5 self.cs_threshold = cs_threshold = 0.005 ################################################## # Blocks ################################################## self.inets_virtual_cs_0 = inets.virtual_cs(1, 20, 10) self.inets_timeout_0_0 = inets.timeout(0, 10, 100, 1000, 0) self.inets_timeout_0 = inets.timeout(0, 10, 100, 1000, 0) self.inets_sending_0 = inets.sending( develop_mode=0, block_id=11, constellation=gnuradio.digital.constellation_qpsk().base(), preamble=diff_preamble_128, samp_rate=samp_rate, sps=sps, system_time_granularity_us=system_time_granularity_us, usrp_device_address=usrp_device_address, center_frequency=tx_center_frequency, interframe_interval_s=0.005, t_pretx_interval_s=0, file_name_extension_t_control="t1TXs", file_name_extension_pending="Tfr", record_on=0, name_with_timestamp=0, tx_gain=0) self.inets_run_0 = inets.run(5, 10) self.inets_rts_framing_0 = inets.rts_framing( 0, 30, 1, 1, destination_address, 1, source_address, 1, 318, 2, 524, 2, 2, 1, 3, padding, diff_preamble_128, gnuradio.digital.constellation_qpsk().bits_per_symbol() * (samp_rate / sps), 1000, 800) self.inets_resend_check_0 = inets.resend_check(0, 24, 6) self.inets_receiving_0 = inets.receiving( 0, 21, gnuradio.digital.constellation_qpsk().base(), rrc, mu, diff_preamble_128, rx_gain, samp_rate, sps, 30, usrp_device_address, rx_center_frequency) self.inets_general_timer_0_1_0 = inets.general_timer(0, 3, 0, 8, 10, 0) self.inets_general_timer_0_1 = inets.general_timer(0, 3, 0, 18, 10, 0) self.inets_general_timer_0_0 = inets.general_timer( 0, 1, 0, 1000000, 10, 0) self.inets_general_timer_0 = inets.general_timer(0, 3, 3, 200, 10, 0) self.inets_framing_0_0 = inets.framing(0, 17, 2, 1, 0, 1, destination_address, 1, source_address, 1, 318, 2, 524, 2, 2, 1, 1, 0, ([2, 3]), ([1000, 1000]), 2, 0, 300, 1) self.inets_framing_0 = inets.framing(0, 17, 1, 1, 0, 1, destination_address, 1, source_address, 1, 318, 2, 524, 2, 2, 1, 1, 0, ([2, 3]), ([1000, 1000]), 2, 0, 300, 1) self.inets_frame_type_check_0_1 = inets.frame_type_check( 1, 25, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1) self.inets_frame_type_check_0_0_0 = inets.frame_type_check( 0, 25, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1) self.inets_frame_type_check_0_0 = inets.frame_type_check( 0, 25, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1) self.inets_frame_type_check_0 = inets.frame_type_check( 0, 25, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1) self.inets_frame_path_1_0_1 = inets.frame_path(0, 39) self.inets_frame_path_1_0_0_0_1_0 = inets.frame_path(0, 39) self.inets_frame_path_1_0_0_0_1 = inets.frame_path(0, 39) self.inets_frame_path_1_0_0_0_0 = inets.frame_path(0, 39) self.inets_frame_path_1_0_0_0 = inets.frame_path(0, 39) self.inets_frame_path_1_0_0 = inets.frame_path(0, 39) self.inets_frame_path_1_0 = inets.frame_path(0, 39) self.inets_frame_path_1 = inets.frame_path(0, 39) self.inets_frame_check_0 = inets.frame_check(0, 9) self.inets_frame_buffer_1 = inets.frame_buffer(0, 16, 10, 1, 1, 1) self.inets_frame_buffer_0 = inets.frame_buffer(0, 16, 1000, 1, 1, 0) self.inets_frame_analysis_0 = inets.frame_analysis( 0, 7, 1, 1, 1, 1, 1, 2, 2, 2, 1, source_address) self.inets_dummy_source_0 = inets.dummy_source(0, 23, 837, 3, 1) self.inets_cts_framing_0 = inets.cts_framing( 0, 31, 1, 1, destination_address, 1, source_address, 1, 318, 2, 524, 2, 2, 1, 3, padding, diff_preamble_128, gnuradio.digital.constellation_qpsk().bits_per_symbol() * (samp_rate / sps), 1000, 800) self.inets_counter_0_1_0_0 = inets.counter(1, 2, 1, "undestined_cts") self.inets_counter_0_1_0 = inets.counter(1, 2, 1, "undestined_rts") self.inets_counter_0_1 = inets.counter(1, 2, 1, "bad_frame") self.inets_counter_0_0_1_1 = inets.counter(1, 1, 1, "tx_ack") self.inets_counter_0_0_1_0_0_0_0_0 = inets.counter(1, 1, 1, "rx_data") self.inets_counter_0_0_1_0_0_0_0 = inets.counter(1, 1, 1, "rx_ack") self.inets_counter_0_0_1_0_0_0 = inets.counter(1, 1, 1, "rx_rts") self.inets_counter_0_0_1_0_0 = inets.counter(1, 1, 1, "rx_cts") self.inets_counter_0_0_1_0 = inets.counter(1, 1, 1, "tx_cts") self.inets_counter_0_0_1 = inets.counter(1, 1, 1, "tx_data") self.inets_counter_0_0_0 = inets.counter(1, 10, 1, "acked") self.inets_counter_0_0 = inets.counter(1, 1, 1, "tx_rts") self.inets_counter_0 = inets.counter(2, 2, 1, "good_frame") self.inets_carrier_sensing_0 = inets.carrier_sensing( 0, 11, 4, 100, 0.005, system_time_granularity_us, 100) self.inets_backoff_1 = inets.backoff(0, 11, 3, 10, 50, 100, 1, 0.005, 10, 1) self.inets_backoff_0 = inets.backoff(0, 11, 1, 5, 10, 400, 1, 0.005, 10, 1) self.inets_address_check_0 = inets.address_check(0, 17, source_address) ################################################## # Connections ################################################## self.msg_connect( (self.inets_address_check_0, 'address_check_pass_out'), (self.inets_frame_type_check_0, 'frame_info_in')) self.msg_connect( (self.inets_address_check_0, 'address_check_fail_out'), (self.inets_frame_type_check_0_1, 'frame_info_in')) self.msg_connect((self.inets_backoff_0, 'frame_info_out'), (self.inets_resend_check_0, 'frame_info_in')) self.msg_connect((self.inets_backoff_1, 'frame_info_out'), (self.inets_counter_0_0_0, 'message_in')) self.msg_connect((self.inets_backoff_1, 'frame_info_out'), (self.inets_frame_buffer_0, 'dequeue')) self.msg_connect((self.inets_carrier_sensing_0, 'frame_info_fail_out'), (self.inets_backoff_0, 'frame_info_in')) self.msg_connect((self.inets_carrier_sensing_0, 'frame_info_pass_out'), (self.inets_frame_buffer_1, 'enqueue')) self.msg_connect((self.inets_cts_framing_0, 'frame_out'), (self.inets_general_timer_0_1_0, 'active_in')) self.msg_connect((self.inets_dummy_source_0, 'output'), (self.inets_framing_0, 'data_in')) self.msg_connect((self.inets_frame_analysis_0, 'frame_info_out'), (self.inets_frame_check_0, 'frame_info_in')) self.msg_connect((self.inets_frame_buffer_0, 'dequeue_element'), (self.inets_rts_framing_0, 'data_frame_in')) self.msg_connect((self.inets_frame_buffer_1, 'dequeue_element'), (self.inets_sending_0, 'in')) self.msg_connect((self.inets_frame_check_0, 'good_frame_info_out'), (self.inets_address_check_0, 'frame_info_in')) self.msg_connect((self.inets_frame_check_0, 'good_frame_info_out'), (self.inets_counter_0, 'message_in')) self.msg_connect((self.inets_frame_check_0, 'bad_frame_info_out'), (self.inets_counter_0_1, 'message_in')) self.msg_connect((self.inets_frame_path_1, 'frame_out'), (self.inets_general_timer_0, 'active_in')) self.msg_connect((self.inets_frame_path_1_0, 'frame_out'), (self.inets_carrier_sensing_0, 'info_in')) self.msg_connect((self.inets_frame_path_1_0, 'frame_out'), (self.inets_general_timer_0_1, 'active_in')) self.msg_connect((self.inets_frame_path_1_0_0, 'frame_out'), (self.inets_frame_buffer_1, 'enqueue')) self.msg_connect((self.inets_frame_path_1_0_0_0, 'frame_out'), (self.inets_frame_buffer_1, 'dequeue')) self.msg_connect((self.inets_frame_path_1_0_0_0_0, 'frame_out'), (self.inets_timeout_0, 'ack_frame_info_in')) self.msg_connect((self.inets_frame_path_1_0_0_0_1, 'frame_out'), (self.inets_counter_0_0_1_0_0, 'message_in')) self.msg_connect((self.inets_frame_path_1_0_0_0_1, 'frame_out'), (self.inets_timeout_0_0, 'cts_frame_info_in')) self.msg_connect((self.inets_frame_path_1_0_0_0_1_0, 'frame_out'), (self.inets_rts_framing_0, 'cts_frame_in')) self.msg_connect((self.inets_frame_path_1_0_1, 'frame_out'), (self.inets_backoff_0, 'frame_info_in')) self.msg_connect((self.inets_frame_type_check_0, 'rts_frame_info_out'), (self.inets_counter_0_0_1_0_0_0, 'message_in')) self.msg_connect((self.inets_frame_type_check_0, 'ack_frame_info_out'), (self.inets_counter_0_0_1_0_0_0_0, 'message_in')) self.msg_connect( (self.inets_frame_type_check_0, 'data_frame_info_out'), (self.inets_counter_0_0_1_0_0_0_0_0, 'message_in')) self.msg_connect((self.inets_frame_type_check_0, 'rts_frame_info_out'), (self.inets_cts_framing_0, 'rts_frame_info_in')) self.msg_connect((self.inets_frame_type_check_0, 'ack_frame_info_out'), (self.inets_frame_path_1_0_0_0_0, 'frame_in')) self.msg_connect((self.inets_frame_type_check_0, 'cts_frame_info_out'), (self.inets_frame_path_1_0_0_0_1, 'frame_in')) self.msg_connect( (self.inets_frame_type_check_0, 'data_frame_info_out'), (self.inets_framing_0_0, 'data_in')) self.msg_connect((self.inets_frame_type_check_0, 'rts_frame_info_out'), (self.inets_virtual_cs_0, 'nav_cmd_in')) self.msg_connect( (self.inets_frame_type_check_0_0, 'ack_frame_info_out'), (self.inets_backoff_1, 'frame_info_in')) self.msg_connect( (self.inets_frame_type_check_0_0, 'data_frame_info_out'), (self.inets_rts_framing_0, 'data_frame_in')) self.msg_connect( (self.inets_frame_type_check_0_0_0, 'cts_frame_info_out'), (self.inets_frame_path_1_0_0_0_1_0, 'frame_in')) self.msg_connect( (self.inets_frame_type_check_0_0_0, 'rts_frame_info_out'), (self.inets_frame_path_1_0_1, 'frame_in')) self.msg_connect( (self.inets_frame_type_check_0_1, 'rts_frame_info_out'), (self.inets_counter_0_1_0, 'message_in')) self.msg_connect( (self.inets_frame_type_check_0_1, 'cts_frame_info_out'), (self.inets_counter_0_1_0_0, 'message_in')) self.msg_connect( (self.inets_frame_type_check_0_1, 'cts_frame_info_out'), (self.inets_virtual_cs_0, 'nav_cmd_in')) self.msg_connect( (self.inets_frame_type_check_0_1, 'rts_frame_info_out'), (self.inets_virtual_cs_0, 'nav_cmd_in')) self.msg_connect((self.inets_framing_0_0, 'frame_out'), (self.inets_general_timer_0_1_0, 'active_in')) self.msg_connect((self.inets_general_timer_0, 'expire_signal_out'), (self.inets_dummy_source_0, 'trigger')) self.msg_connect((self.inets_general_timer_0, 'expire_signal_out'), (self.inets_frame_path_1, 'frame_in')) self.msg_connect((self.inets_general_timer_0_0, 'expire_signal_out'), (self.inets_general_timer_0, 'disable_timer_in')) self.msg_connect((self.inets_general_timer_0_1, 'expire_signal_out'), (self.inets_carrier_sensing_0, 'stop_in')) self.msg_connect((self.inets_general_timer_0_1_0, 'expire_signal_out'), (self.inets_frame_path_1_0_0, 'frame_in')) self.msg_connect((self.inets_receiving_0, 'rx_power_out'), (self.inets_carrier_sensing_0, 'power_in')) self.msg_connect((self.inets_receiving_0, 'rx_frame_out'), (self.inets_frame_analysis_0, 'frame_in')) self.msg_connect((self.inets_resend_check_0, 'resend_check_fail_out'), (self.inets_frame_buffer_0, 'dequeue')) self.msg_connect((self.inets_resend_check_0, 'resend_check_pass_out'), (self.inets_frame_path_1_0, 'frame_in')) self.msg_connect((self.inets_rts_framing_0, 'frame_out'), (self.inets_virtual_cs_0, 'frame_cmd_in')) self.msg_connect((self.inets_run_0, 'trigger_out'), (self.inets_general_timer_0, 'active_in')) self.msg_connect((self.inets_run_0, 'trigger_out'), (self.inets_general_timer_0_0, 'active_in')) self.msg_connect((self.inets_sending_0, 'rts_frame_out'), (self.inets_counter_0_0, 'message_in')) self.msg_connect((self.inets_sending_0, 'data_frame_out'), (self.inets_counter_0_0_1, 'message_in')) self.msg_connect((self.inets_sending_0, 'cts_frame_out'), (self.inets_counter_0_0_1_0, 'message_in')) self.msg_connect((self.inets_sending_0, 'ack_frame_out'), (self.inets_counter_0_0_1_1, 'message_in')) self.msg_connect((self.inets_sending_0, 'rx_control_out'), (self.inets_frame_path_1_0_0_0, 'frame_in')) self.msg_connect((self.inets_sending_0, 'data_frame_out'), (self.inets_timeout_0, 'data_frame_info_in')) self.msg_connect((self.inets_sending_0, 'rts_frame_out'), (self.inets_timeout_0_0, 'rts_frame_info_in')) self.msg_connect((self.inets_timeout_0, 'frame_info_out'), (self.inets_frame_type_check_0_0, 'frame_info_in')) self.msg_connect((self.inets_timeout_0_0, 'frame_info_out'), (self.inets_frame_type_check_0_0_0, 'frame_info_in')) self.msg_connect((self.inets_virtual_cs_0, 'frame_cmd_out'), (self.inets_frame_path_1_0, 'frame_in'))
def __init__(self): gr.top_block.__init__(self, "two_way_handshake_test_Rx") Qt.QWidget.__init__(self) self.setWindowTitle("two_way_handshake_test_Rx") qtgui.util.check_set_qss() try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "two_way_handshake_test_Rx") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.sps = sps = 4 self.range_rx_gain = range_rx_gain = 0 self.range_mu = range_mu = 0.6 self.usrp_device_address = usrp_device_address = "addr=10.0.0.20" self.tx_center_frequency = tx_center_frequency = 3.9e8 self.system_time_granularity_us = system_time_granularity_us = 1000 self.source_address = source_address = 1 self.samp_rate = samp_rate = 400000 self.rx_gain = rx_gain = range_rx_gain self.rx_center_frequency = rx_center_frequency = 3.9e8 self.rrc = rrc = firdes.root_raised_cosine(1.0, sps, 1, 0.5, 11*sps) self.mu = mu = range_mu self.diff_preamble_128 = diff_preamble_128 = [1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0,0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0,0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1,1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0][0:128] self.destination_address = destination_address = 3 self.cs_threshold = cs_threshold = 0.005 ################################################## # Blocks ################################################## self._range_rx_gain_range = Range(0, 60, 1, 0, 200) self._range_rx_gain_win = RangeWidget(self._range_rx_gain_range, self.set_range_rx_gain, 'Rx Gain', "counter_slider", float) self.top_grid_layout.addWidget(self._range_rx_gain_win, 1,0,1,1) self._range_mu_range = Range(0, 1, 0.01, 0.6, 200) self._range_mu_win = RangeWidget(self._range_mu_range, self.set_range_mu, 'BB Derotation Gain', "counter_slider", float) self.top_grid_layout.addWidget(self._range_mu_win, 2,0,1,1) self.inets_sending_0 = inets.sending(develop_mode=0, block_id=11, constellation=gnuradio.digital.constellation_qpsk().base(), preamble=diff_preamble_128, samp_rate=samp_rate, sps=sps, system_time_granularity_us=system_time_granularity_us, usrp_device_address=usrp_device_address, center_frequency=tx_center_frequency, interframe_interval_s=0.006, t_pretx_interval_s=0, file_name_extension_t_control="t2TXs", file_name_extension_pending="T2fr", record_on=1, name_with_timestamp=0, tx_gain=0) self.inets_receiving_0 = inets.receiving(0, 21, gnuradio.digital.constellation_qpsk().base(), rrc, mu, diff_preamble_128, rx_gain, samp_rate, sps, 30, usrp_device_address, rx_center_frequency) self.inets_framing_0 = inets.framing(0, 17, 2, 1, 0, 1, destination_address, 1, source_address, 1, 318, 2, 524, 2, 2, 1, 1, 0, ([2, 3]), ([1000, 1000]), 2, 0, 300, 1) self.inets_frame_type_check_0 = inets.frame_type_check(0, 25, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1) self.inets_frame_probe_0_0_1 = inets.frame_probe(2, 100, 0, 1, 0.005, 0, "/home/inets/source/gr-inets/results/", "t2CS", 0) self.inets_frame_probe_0_0 = inets.frame_probe(2, 102, 0, 0, 0.01, 1, "/home/inets/source/gr-inets/results/", "t2e", 0) self.inets_frame_probe_0 = inets.frame_probe(2, 101, 0, 0, 0.01, 1, "/home/inets/source/gr-inets/results/", "t2RXe", 0) self.inets_frame_check_0 = inets.frame_check(0, 9) self.inets_frame_analysis_0 = inets.frame_analysis(0, 7, 1, 1, 1, 1, 1, 2, 2, 2, 1, source_address) self.inets_address_check_0 = inets.address_check(0, 17, 1) ################################################## # Connections ################################################## self.msg_connect((self.inets_address_check_0, 'address_check_pass_out'), (self.inets_frame_type_check_0, 'frame_info_in')) self.msg_connect((self.inets_frame_analysis_0, 'frame_info_out'), (self.inets_frame_check_0, 'frame_info_in')) self.msg_connect((self.inets_frame_check_0, 'good_frame_info_out'), (self.inets_address_check_0, 'frame_info_in')) self.msg_connect((self.inets_frame_type_check_0, 'data_frame_info_out'), (self.inets_frame_probe_0, 'info_in')) self.msg_connect((self.inets_frame_type_check_0, 'data_frame_info_out'), (self.inets_framing_0, 'data_in')) self.msg_connect((self.inets_framing_0, 'frame_out'), (self.inets_receiving_0, 'rx_switch_in')) self.msg_connect((self.inets_receiving_0, 'rx_frame_out'), (self.inets_frame_analysis_0, 'frame_in')) self.msg_connect((self.inets_receiving_0, 'rx_power_out'), (self.inets_frame_probe_0_0_1, 'info_in')) self.msg_connect((self.inets_receiving_0, 'rx_switch_out'), (self.inets_sending_0, 'in')) self.msg_connect((self.inets_sending_0, 'ack_frame_out'), (self.inets_frame_probe_0_0, 'info_in')) self.msg_connect((self.inets_sending_0, 'rx_control_out'), (self.inets_receiving_0, 'rx_switch_in'))
def __init__(self): gr.top_block.__init__(self, "Test_frame_buffer") Qt.QWidget.__init__(self) self.setWindowTitle("Test_frame_buffer") qtgui.util.check_set_qss() try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "Test_frame_buffer") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.sps = sps = 4 self.range_rx_gain = range_rx_gain = 15 self.range_mu = range_mu = 0.6 self.usrp_device_address = usrp_device_address = "addr=10.0.0.6" self.system_time_granularity_us = system_time_granularity_us = 1000 self.samp_rate = samp_rate = 32000 self.rx_gain = rx_gain = range_rx_gain self.rrc = rrc = firdes.root_raised_cosine(1.0, sps, 1, 0.5, 11 * sps) self.mu = mu = range_mu self.diff_preamble_128 = diff_preamble_128 = [ 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0 ][0:128] self.cs_threshold = cs_threshold = 0.005 ################################################## # Blocks ################################################## self._range_rx_gain_range = Range(0, 60, 1, 15, 200) self._range_rx_gain_win = RangeWidget(self._range_rx_gain_range, self.set_range_rx_gain, 'Rx Gain', "counter_slider", float) self.top_grid_layout.addWidget(self._range_rx_gain_win, 1, 0, 1, 1) self._range_mu_range = Range(0, 1, 0.01, 0.6, 200) self._range_mu_win = RangeWidget(self._range_mu_range, self.set_range_mu, 'BB Derotation Gain', "counter_slider", float) self.top_grid_layout.addWidget(self._range_mu_win, 2, 0, 1, 1) self.inets_timeout_0 = inets.timeout(0, 10, 100, 1000) self.inets_sending_0 = inets.sending( develop_mode=1, block_id=11, constellation=gnuradio.digital.constellation_qpsk().base(), preamble=diff_preamble_128, samp_rate=samp_rate, sps=sps, system_time_granularity_us=system_time_granularity_us, usrp_device_address=usrp_device_address) self.inets_receiving_0 = inets.receiving( 2, 11, gnuradio.digital.constellation_qpsk().base(), rrc, mu, diff_preamble_128, rx_gain, samp_rate, sps, cs_threshold, usrp_device_address) self.inets_framing_0_0 = inets.framing(0, 17, 2, 1, 1, 1, 5, 1, 1, 1, 0, 2, 0, 2, 1, 1, 0, 0) self.inets_framing_0 = inets.framing(0, 17, 1, 1, 1, 1, 5, 1, 1, 1, 0, 2, 0, 2, 1, 1, 0, 0) self.inets_frame_type_check_0_0 = inets.frame_type_check( 0, 0, 1, 1, 1, 1, 1, 1) self.inets_frame_type_check_0 = inets.frame_type_check( 0, 0, 1, 1, 1, 1, 1, 1) self.inets_frame_buffer_0 = inets.frame_buffer(0, 16, 10, 1) self.inets_carrier_sensing_0 = inets.carrier_sensing( 0, 11, 2, 100, 0.005, 1000) self.inets_backoff_0 = inets.backoff(0, 11, 3, 1, 10, 6, 100, 400) self.inets_address_check_0 = inets.address_check(0, 17, 1) self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_SERVER", 'localhost', '52001', 10000, False) ################################################## # Connections ################################################## self.msg_connect((self.blocks_socket_pdu_0, 'pdus'), (self.inets_framing_0, 'data_in')) self.msg_connect( (self.inets_address_check_0, 'address_check_pass_out'), (self.inets_framing_0_0, 'data_in')) self.msg_connect((self.inets_backoff_0, 'resend_frame_info_out'), (self.inets_carrier_sensing_0, 'info_in')) self.msg_connect((self.inets_carrier_sensing_0, 'frame_info_pass_out'), (self.inets_sending_0, 'in')) self.msg_connect((self.inets_frame_buffer_0, 'dequeue_element'), (self.inets_carrier_sensing_0, 'info_in')) self.msg_connect( (self.inets_frame_type_check_0, 'data_frame_info_out'), (self.inets_address_check_0, 'frame_info_in')) self.msg_connect((self.inets_frame_type_check_0, 'ack_frame_info_out'), (self.inets_timeout_0, 'ack_frame_info_in')) self.msg_connect( (self.inets_frame_type_check_0_0, 'data_frame_info_out'), (self.inets_backoff_0, 'frame_info_trigger_in')) self.msg_connect( (self.inets_frame_type_check_0_0, 'ack_frame_info_out'), (self.inets_frame_buffer_0, 'dequeue')) self.msg_connect((self.inets_framing_0, 'frame_out'), (self.inets_frame_buffer_0, 'enqueue')) self.msg_connect((self.inets_framing_0_0, 'frame_out'), (self.inets_carrier_sensing_0, 'info_in')) self.msg_connect((self.inets_receiving_0, 'rx_power_out'), (self.inets_carrier_sensing_0, 'info_in')) self.msg_connect((self.inets_receiving_0, 'rx_frame_out'), (self.inets_frame_type_check_0, 'frame_info_in')) self.msg_connect((self.inets_sending_0, 'tx_frame_info_out'), (self.inets_timeout_0, 'data_frame_info_in')) self.msg_connect((self.inets_timeout_0, 'frame_info_out'), (self.inets_frame_type_check_0_0, 'frame_info_in'))
def __init__(self): gr.top_block.__init__(self, "standard_csma") Qt.QWidget.__init__(self) self.setWindowTitle("standard_csma") qtgui.util.check_set_qss() try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "standard_csma") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.sps = sps = 4 self.range_rx_gain = range_rx_gain = 0 self.range_mu = range_mu = 0.6 self.usrp_device_address = usrp_device_address = "addr=10.0.0.6" self.tx_center_frequency = tx_center_frequency = 3.9e8 self.system_time_granularity_us = system_time_granularity_us = 1000 self.source_address = source_address = 1 self.samp_rate = samp_rate = 2000000 self.rx_gain = rx_gain = range_rx_gain self.rx_center_frequency = rx_center_frequency = 3.9e8 self.rrc = rrc = firdes.root_raised_cosine(1.0, sps, 1, 0.5, 11*sps) self.mu = mu = range_mu self.diff_preamble_128 = diff_preamble_128 = [1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0,0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0,0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1,1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0][0:128] self.destination_address = destination_address = 3 self.cs_threshold = cs_threshold = 0.005 ################################################## # Blocks ################################################## self._range_rx_gain_range = Range(0, 60, 1, 0, 200) self._range_rx_gain_win = RangeWidget(self._range_rx_gain_range, self.set_range_rx_gain, 'Rx Gain', "counter_slider", float) self.top_grid_layout.addWidget(self._range_rx_gain_win, 1,0,1,1) self._range_mu_range = Range(0, 1, 0.01, 0.6, 200) self._range_mu_win = RangeWidget(self._range_mu_range, self.set_range_mu, 'BB Derotation Gain', "counter_slider", float) self.top_grid_layout.addWidget(self._range_mu_win, 2,0,1,1) self.inets_receiving_0 = inets.receiving(0, 21, gnuradio.digital.constellation_qpsk().base(), rrc, mu, diff_preamble_128, rx_gain, samp_rate, sps, 30, usrp_device_address, rx_center_frequency) self.inets_frame_type_check_0 = inets.frame_type_check(0, 25, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1) self.inets_frame_analysis_0 = inets.frame_analysis(0, 7, 1, 1, 1, 1, 1, 2, 2, 2, 1, source_address) self.inets_address_check_0 = inets.address_check(0, 17, source_address) self.blocks_socket_pdu_1 = blocks.socket_pdu("UDP_CLIENT", 'localhost', '1234', 300, False) ################################################## # Connections ################################################## self.msg_connect((self.inets_address_check_0, 'address_check_pass_out'), (self.inets_frame_type_check_0, 'frame_info_in')) self.msg_connect((self.inets_frame_analysis_0, 'frame_info_out'), (self.inets_address_check_0, 'frame_info_in')) self.msg_connect((self.inets_frame_type_check_0, 'data_frame_info_out'), (self.blocks_socket_pdu_1, 'pdus')) self.msg_connect((self.inets_receiving_0, 'rx_frame_out'), (self.inets_frame_analysis_0, 'frame_in'))
def __init__(self): gr.top_block.__init__(self, "csma") Qt.QWidget.__init__(self) self.setWindowTitle("csma") qtgui.util.check_set_qss() try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "csma") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Variables ################################################## self.sps = sps = 4 self.range_rx_gain = range_rx_gain = 15 self.range_mu = range_mu = 0.6 self.usrp_device_address = usrp_device_address = "addr=10.0.0.6" self.timeout_duration_ms = timeout_duration_ms = 1000 self.system_time_granularity_us = system_time_granularity_us = 1000 self.source_address = source_address = 1 self.self_data_info = self_data_info = pmt.to_pmt({ 'frame_type': 1, 'frame_index': 1, 'destination_address': 2, 'source_address': 1, 'num_resend': 3, 'reserved_field_I': 1, 'reserved_field_II': 1, 'pay_load_length': 200 }) self.self_ack_info = self_ack_info = pmt.to_pmt({ 'frame_type': 2, 'frame_index': 1, 'destination_address': 2, 'source_address': 1, 'num_resend': 0, 'reserved_field_I': 1, 'reserved_field_II': 1, 'pay_load_length': 0 }) self.samp_rate = samp_rate = 1000000 self.rx_gain = rx_gain = range_rx_gain self.rrc = rrc = firdes.root_raised_cosine(1.0, sps, 1, 0.5, 11 * sps) self.reserved_field_II = reserved_field_II = 6 self.reserved_field_I = reserved_field_I = 5 self.preamble_detector_threshold = preamble_detector_threshold = 30 self.mu = mu = range_mu self.min_backoff_ms = min_backoff_ms = 50 self.max_num_retransmission = max_num_retransmission = 5 self.max_buffer_size = max_buffer_size = 10 self.len_source_address = len_source_address = 1 self.len_reserved_field_II = len_reserved_field_II = 2 self.len_reserved_field_I = len_reserved_field_I = 2 self.len_payload_length = len_payload_length = 1 self.len_num_transmission = len_num_transmission = 1 self.len_frame_type = len_frame_type = 1 self.len_frame_index = len_frame_index = 1 self.len_destination_address = len_destination_address = 1 self.increase_index = increase_index = 1 self.frame_type = frame_type = 1 self.frame_index = frame_index = 0 self.experiment_duration_s = experiment_duration_s = 1000 self.diff_preamble_128 = diff_preamble_128 = [ 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0 ][0:128] self.develop_mode_list = develop_mode_list = [0] self.destination_address = destination_address = 2 self.cs_threshold = cs_threshold = 0.005 self.cs_duration = cs_duration = 50 self.counter_id = counter_id = 20 self.backoff_time_unit_ms = backoff_time_unit_ms = 50 self.apply_address_check = apply_address_check = 1 self.another_data_info = another_data_info = pmt.to_pmt({ 'frame_type': 1, 'frame_index': 1, 'destination_address': 1, 'source_address': 2, 'num_resend': 3, 'reserved_field_I': 1, 'reserved_field_II': 1, 'pay_load_length': 200 }) self.another_ack_info = another_ack_info = pmt.to_pmt({ 'good_frame': 1, 'address_check': 1, 'header_length': 9, 'payload_length': 0, 'reserved_field_II': 6, 'reserved_field_I': 5, 'num_transmission': 0, 'source_address': 1, 'destination_address': 3, 'frame_index': 22, 'frame_type': 1 }) ################################################## # Blocks ################################################## self.send_frame_0 = send_frame( block_id=2, constellation=gnuradio.digital.constellation_qpsk().base(), develop_mode=1, preamble=diff_preamble_128, samp_rate=samp_rate, sps=sps, system_time_granularity_us=system_time_granularity_us, usrp_device_address=usrp_device_address, ) self.receive_frame_0_0 = receive_frame( apply_address_check=apply_address_check, block_id=3, constellation=gnuradio.digital.constellation_qpsk().base(), develop_mode=[11], len_destination_address=len_destination_address, len_frame_index=len_frame_index, len_frame_type=len_frame_type, len_num_transmission=1, len_payload_length=len_payload_length, len_reserved_field_I=len_reserved_field_I, len_reserved_field_II=len_reserved_field_II, len_source_address=len_source_address, matched_filter_coeff=rrc, mu=mu, my_address=source_address, preamble=diff_preamble_128, rx_gain=rx_gain, samp_rate=samp_rate, sps=sps, threshold=preamble_detector_threshold, usrp_device_address="addr=10.0.0.6", ) self._range_rx_gain_range = Range(0, 60, 1, 15, 200) self._range_rx_gain_win = RangeWidget(self._range_rx_gain_range, self.set_range_rx_gain, 'Rx Gain', "counter_slider", float) self.top_grid_layout.addWidget(self._range_rx_gain_win, 1, 0, 1, 1) self._range_mu_range = Range(0, 1, 0.01, 0.6, 200) self._range_mu_win = RangeWidget(self._range_mu_range, self.set_range_mu, 'BB Derotation Gain', "counter_slider", float) self.top_grid_layout.addWidget(self._range_mu_win, 2, 0, 1, 1) self.inets_timeout_cpp_0 = inets.timeout_cpp( 0, 10, timeout_duration_ms, system_time_granularity_us) self.inets_idle_0 = inets.idle( 0, 1, experiment_duration_s, max_num_retransmission, max_buffer_size, frame_type, len_frame_type, frame_index, len_frame_index, destination_address, len_destination_address, source_address, len_source_address, reserved_field_I, len_reserved_field_I, reserved_field_II, len_reserved_field_II, len_payload_length, increase_index, len_num_transmission) self.inets_frame_type_check_0_1 = inets.frame_type_check(0, 0, 1, 1, 1) self.inets_frame_type_check_0_0 = inets.frame_type_check(0, 0, 1, 1, 1) self.inets_frame_type_check_0 = inets.frame_type_check(0, 0, 1, 1, 1) self.inets_exponential_backoff_cpp_0 = inets.exponential_backoff_cpp( 0, 11, backoff_time_unit_ms, max_num_retransmission, min_backoff_ms) self.inets_counter_0_1 = inets.counter(([22]), 22) self.inets_carrier_sensing_cpp_cc_0 = inets.carrier_sensing_cpp_cc( 0, 11, 1, cs_duration, cs_threshold, system_time_granularity_us) self.frame_info_simulator = blocks.message_strobe_random( pmt.to_pmt({ 'good_frame': 1, 'address_check': 1, 'header_length': 9, 'payload_length': 0, 'reserved_field_II': 6, 'reserved_field_I': 5, 'num_transmission': 0, 'source_address': 1, 'destination_address': 3, 'frame_index': 22, 'frame_type': 1 }), blocks.STROBE_POISSON, 2000, 1000) self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_SERVER", 'localhost', '52001', 10000, False) self.blocks_message_strobe_random_1 = blocks.message_strobe_random( pmt.from_bool(True), blocks.STROBE_POISSON, 2000, 5) ################################################## # Connections ################################################## self.msg_connect((self.blocks_socket_pdu_0, 'pdus'), (self.inets_idle_0, 'data_in')) self.msg_connect( (self.inets_carrier_sensing_cpp_cc_0, 'frame_info_fail_out'), (self.inets_exponential_backoff_cpp_0, 'frame_info_trigger_in')) self.msg_connect( (self.inets_carrier_sensing_cpp_cc_0, 'frame_info_pass_out'), (self.send_frame_0, 'in')) self.msg_connect( (self.inets_exponential_backoff_cpp_0, 'frame_info_out'), (self.inets_idle_0, 'data_in')) self.msg_connect( (self.inets_frame_type_check_0, 'data_frame_info_out'), (self.inets_idle_0, 'data_in')) self.msg_connect((self.inets_frame_type_check_0, 'ack_frame_info_out'), (self.inets_timeout_cpp_0, 'ack_frame_info_in')) self.msg_connect( (self.inets_frame_type_check_0_0, 'data_frame_info_out'), (self.inets_timeout_cpp_0, 'data_frame_info_in')) self.msg_connect( (self.inets_frame_type_check_0_1, 'data_frame_info_out'), (self.inets_exponential_backoff_cpp_0, 'frame_info_trigger_in')) self.msg_connect( (self.inets_frame_type_check_0_1, 'ack_frame_info_out'), (self.inets_idle_0, 'data_in')) self.msg_connect((self.inets_idle_0, 'data_out'), (self.inets_carrier_sensing_cpp_cc_0, 'info_in')) self.msg_connect((self.inets_idle_0, 'successful_transmission'), (self.inets_counter_0_1, 'message_in')) self.msg_connect((self.inets_timeout_cpp_0, 'frame_info_out'), (self.inets_frame_type_check_0_1, 'frame_info_in')) self.msg_connect((self.receive_frame_0_0, 'rx_frame_info_out'), (self.inets_frame_type_check_0, 'frame_info_in')) self.msg_connect((self.send_frame_0, 'tx_frame_info_out'), (self.inets_frame_type_check_0_0, 'frame_info_in'))
def __init__(self, constellation=gnuradio.digital.constellation_qpsk().base()): gr.top_block.__init__(self, "Test_slide_window") Qt.QWidget.__init__(self) self.setWindowTitle("Test_slide_window") qtgui.util.check_set_qss() try: self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) except: pass self.top_scroll_layout = Qt.QVBoxLayout() self.setLayout(self.top_scroll_layout) self.top_scroll = Qt.QScrollArea() self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) self.top_scroll_layout.addWidget(self.top_scroll) self.top_scroll.setWidgetResizable(True) self.top_widget = Qt.QWidget() self.top_scroll.setWidget(self.top_widget) self.top_layout = Qt.QVBoxLayout(self.top_widget) self.top_grid_layout = Qt.QGridLayout() self.top_layout.addLayout(self.top_grid_layout) self.settings = Qt.QSettings("GNU Radio", "Test_slide_window") self.restoreGeometry(self.settings.value("geometry").toByteArray()) ################################################## # Parameters ################################################## self.constellation = constellation ################################################## # Variables ################################################## self.sps = sps = 4 self.range_rx_gain = range_rx_gain = 0 self.range_mu = range_mu = 0.6 self.usrp_device_address = usrp_device_address = "addr=10.0.0.6" self.tx_center_frequency = tx_center_frequency = 3.8e8 self.system_time_granularity_us = system_time_granularity_us = 1000 self.source_address = source_address = 1 self.samp_rate = samp_rate = 1000000 self.rx_gain = rx_gain = range_rx_gain self.rx_center_frequency = rx_center_frequency = 3.9e8 self.rrc = rrc = firdes.root_raised_cosine(1.0, sps, 1, 0.5, 11 * sps) self.mu = mu = range_mu self.diff_preamble_128 = diff_preamble_128 = [ 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0 ][0:128] self.destination_address = destination_address = 2 self.cs_threshold = cs_threshold = 0.005 ################################################## # Blocks ################################################## self._range_rx_gain_range = Range(0, 1, 1, 0, 200) self._range_rx_gain_win = RangeWidget(self._range_rx_gain_range, self.set_range_rx_gain, 'Rx Gain', "counter_slider", float) self.top_grid_layout.addWidget(self._range_rx_gain_win, 1, 0, 1, 1) self._range_mu_range = Range(0, 1, 0.01, 0.6, 200) self._range_mu_win = RangeWidget(self._range_mu_range, self.set_range_mu, 'BB Derotation Gain', "counter_slider", float) self.top_grid_layout.addWidget(self._range_mu_win, 2, 0, 1, 1) self.inets_timeout_0 = inets.timeout(0, 10, 1000, 1000, 1) self.inets_slide_window_0 = inets.slide_window( 1, 22, 5, 1, constellation.bits_per_symbol() * (samp_rate / sps), 200, 1) self.inets_sending_0 = inets.sending( develop_mode=0, block_id=11, constellation=gnuradio.digital.constellation_qpsk().base(), preamble=diff_preamble_128, samp_rate=samp_rate, sps=sps, system_time_granularity_us=system_time_granularity_us, usrp_device_address=usrp_device_address, center_frequency=tx_center_frequency) self.inets_receiving_0 = inets.receiving( 1, 21, gnuradio.digital.constellation_qpsk().base(), rrc, mu, diff_preamble_128, rx_gain, samp_rate, sps, 30, usrp_device_address, rx_center_frequency) self.inets_framing_1 = inets.framing(0, 17, 2, 1, 0, 1, destination_address, 1, source_address, 1, 318, 2, 524, 2, 2, 1, 1, 0) self.inets_framing_0 = inets.framing(0, 17, 1, 1, 0, 1, destination_address, 1, source_address, 1, 318, 2, 524, 2, 2, 1, 1, 0) self.inets_frame_type_check_0 = inets.frame_type_check( 0, 25, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1) self.inets_frame_probe_0 = inets.frame_probe(1, 100, 0) self.inets_frame_index_check_0 = inets.frame_index_check( 1, 28, 1, 1, 1, 1, 1) self.inets_frame_filter_1 = inets.frame_filter(0, 26, 0, 0, 0, 0, 8, 0, 0, 1) self.inets_frame_buffer_0 = inets.frame_buffer(0, 16, 10, 1, 1) self.inets_frame_analysis_0 = inets.frame_analysis( 0, 7, 1, 1, 1, 1, 1, 2, 2, 2, 1, source_address) self.inets_dummy_source_0 = inets.dummy_source(0, 23, 100, 2, 20) self.inets_address_check_0 = inets.address_check(0, 17, source_address) self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_SERVER", 'localhost', '52001', 10000, False) self.blocks_message_strobe_0 = blocks.message_strobe( pmt.intern("TEST"), 1000) ################################################## # Connections ################################################## self.msg_connect((self.blocks_message_strobe_0, 'strobe'), (self.inets_dummy_source_0, 'trigger')) self.msg_connect( (self.inets_address_check_0, 'address_check_pass_out'), (self.inets_frame_type_check_0, 'frame_info_in')) self.msg_connect((self.inets_dummy_source_0, 'output'), (self.inets_frame_buffer_0, 'enqueue')) self.msg_connect((self.inets_frame_analysis_0, 'frame_info_out'), (self.inets_address_check_0, 'frame_info_in')) self.msg_connect((self.inets_frame_buffer_0, 'dequeue_element'), (self.inets_framing_0, 'data_in')) self.msg_connect((self.inets_frame_filter_1, 'frame_info_out'), (self.inets_sending_0, 'in')) self.msg_connect((self.inets_frame_index_check_0, 'frame_info_out'), (self.inets_sending_0, 'in')) self.msg_connect( (self.inets_frame_type_check_0, 'data_frame_info_out'), (self.inets_framing_1, 'data_in')) self.msg_connect((self.inets_frame_type_check_0, 'ack_frame_info_out'), (self.inets_timeout_0, 'ack_frame_info_in')) self.msg_connect((self.inets_framing_0, 'frame_out'), (self.inets_slide_window_0, 'frame_info_in')) self.msg_connect((self.inets_framing_1, 'frame_out'), (self.inets_frame_index_check_0, 'frame_in')) self.msg_connect((self.inets_receiving_0, 'rx_frame_out'), (self.inets_frame_analysis_0, 'frame_in')) self.msg_connect((self.inets_slide_window_0, 'reload_request'), (self.inets_frame_buffer_0, 'dequeue')) self.msg_connect((self.inets_slide_window_0, 'frame_info_out'), (self.inets_frame_filter_1, 'frame_info_in')) self.msg_connect((self.inets_slide_window_0, 'frame_info_out'), (self.inets_timeout_0, 'data_frame_info_in')) self.msg_connect((self.inets_timeout_0, 'frame_info_out'), (self.inets_slide_window_0, 'ack_info_in'))