diff --git a/workspace/awgn.grc b/workspace/awgn.grc
deleted file mode 100644
index e69de29..0000000
diff --git a/workspace/wifi_loopback_noGUI.grc b/workspace/wifi_loopback_noGUI.grc
index 70a620b..87d9790 100644
--- a/workspace/wifi_loopback_noGUI.grc
+++ b/workspace/wifi_loopback_noGUI.grc
@@ -42,7 +42,7 @@
id
- wifi_loopback
+ wifi_loopback_noGUI
max_nouts
@@ -62,7 +62,7 @@
run_options
- prompt
+ run
run
@@ -89,7 +89,7 @@
_coordinate
- (176, 11)
+ (272, 59)
_rotation
@@ -124,15 +124,15 @@
_enabled
- False
+ True
file
- /tmp/ofdm.bin
+ /tmp/ofdm_n" + str(nmessages) + "_s" + str(snr) + "_e" + str(encoding) + "_i" + str(interval) + ".pcap
_coordinate
- (896, 187)
+ (64, 331)
_rotation
@@ -140,7 +140,7 @@
id
- blocks_file_sink_0
+ blocks_file_sink_0_0
type
@@ -155,53 +155,6 @@
1
-
- blocks_message_strobe
-
- alias
-
-
-
- comment
-
-
-
- affinity
-
-
-
- _enabled
- True
-
-
- _coordinate
- (48, 131)
-
-
- _rotation
- 0
-
-
- id
- blocks_message_strobe_0
-
-
- maxoutbuf
- 0
-
-
- msg
- pmt.intern("".join("x" for i in range(pdu_length)))
-
-
- minoutbuf
- 0
-
-
- period
- interval
-
-
blocks_multiply_const_vxx
@@ -277,11 +230,11 @@
_coordinate
- (232, 545)
+ (296, 313)
_rotation
- 0
+ 180
id
@@ -300,100 +253,6 @@
1
-
- blocks_null_sink
-
- alias
-
-
-
- bus_conns
- [[0,],]
-
-
- comment
-
-
-
- affinity
-
-
-
- _enabled
- True
-
-
- _coordinate
- (480, 633)
-
-
- _rotation
- 0
-
-
- id
- blocks_null_sink_1
-
-
- type
- float
-
-
- num_inputs
- 1
-
-
- vlen
- 1
-
-
-
- blocks_pdu_to_tagged_stream
-
- alias
-
-
-
- comment
-
-
-
- affinity
-
-
-
- _enabled
- True
-
-
- _coordinate
- (136, 635)
-
-
- _rotation
- 0
-
-
- id
- blocks_pdu_to_tagged_stream_0
-
-
- type
- float
-
-
- tag
- packet_len
-
-
- maxoutbuf
- 0
-
-
- minoutbuf
- 0
-
-
parameter
@@ -427,7 +286,7 @@ Else: 0
short_id
-
+ c
type
@@ -533,7 +392,7 @@ Else: 0
short_id
-
+ e
type
@@ -603,6 +462,65 @@ Else: 0
0
+
+ foo_periodic_msg_source
+
+ alias
+
+
+
+ comment
+
+
+
+ affinity
+
+
+
+ debug
+ False
+
+
+ _enabled
+ True
+
+
+ _coordinate
+ (64, 131)
+
+
+ _rotation
+ 0
+
+
+ id
+ foo_periodic_msg_source_0
+
+
+ maxoutbuf
+ 0
+
+
+ msg
+ pmt.intern("Hello World!")
+
+
+ minoutbuf
+ 0
+
+
+ num
+ nmessages
+
+
+ interval
+ interval
+
+
+ quit
+ True
+
+
foo_wireshark_connector
@@ -623,15 +541,15 @@ Else: 0
_enabled
- False
+ True
_coordinate
- (688, 195)
+ (96, 259)
_rotation
- 0
+ 180
id
@@ -685,7 +603,7 @@ Max: 0.1
short_id
-
+ o
type
@@ -724,7 +642,7 @@ Max: 0.1
_coordinate
- (416, 139)
+ (416, 163)
_rotation
@@ -747,53 +665,6 @@ Max: 0.1
[0x23, 0x23, 0x23, 0x23, 0x23, 0x23]
-
- ieee802_11_ofdm_parse_mac
-
- alias
-
-
-
- comment
-
-
-
- affinity
-
-
-
- debug
- True
-
-
- _enabled
- True
-
-
- _coordinate
- (112, 259)
-
-
- _rotation
- 180
-
-
- id
- ieee802_11_ofdm_parse_mac_0
-
-
- log
- False
-
-
- maxoutbuf
- 0
-
-
- minoutbuf
- 0
-
-
import
@@ -860,7 +731,7 @@ Max: 1000
short_id
-
+ i
type
@@ -897,7 +768,7 @@ Max: 1500
id
- pdu_length
+ nmessages
label
@@ -905,7 +776,7 @@ Max: 1500
short_id
-
+ n
type
@@ -913,7 +784,7 @@ Max: 1500
value
- 500
+ 50
@@ -951,7 +822,7 @@ Max: 30
short_id
-
+ s
type
@@ -1009,24 +880,12 @@ Max: 30
encoding
-
- blocks_message_strobe_0
- ieee802_11_ofdm_mac_0
- strobe
- app in
-
blocks_multiply_const_vxx_0
channels_channel_model_0
0
0
-
- blocks_pdu_to_tagged_stream_0
- blocks_null_sink_1
- 0
- 0
-
channels_channel_model_0
wifi_phy_hier_0
@@ -1039,9 +898,21 @@ Max: 30
0
0
+
+ foo_periodic_msg_source_0
+ foo_wireshark_connector_0
+ out
+ in
+
+
+ foo_periodic_msg_source_0
+ ieee802_11_ofdm_mac_0
+ out
+ app in
+
foo_wireshark_connector_0
- blocks_file_sink_0
+ blocks_file_sink_0_0
0
0
@@ -1051,12 +922,6 @@ Max: 30
phy out
mac_in
-
- ieee802_11_ofdm_parse_mac_0
- blocks_pdu_to_tagged_stream_0
- fer
- pdus
-
wifi_phy_hier_0
blocks_null_sink_0
@@ -1065,7 +930,7 @@ Max: 30
wifi_phy_hier_0
- ieee802_11_ofdm_parse_mac_0
+ foo_wireshark_connector_0
mac_out
in
diff --git a/workspace/wifi_loopback.py b/workspace/wifi_loopback_noGUI.py
similarity index 63%
rename from workspace/wifi_loopback.py
rename to workspace/wifi_loopback_noGUI.py
index 8a619b7..5b715f0 100755
--- a/workspace/wifi_loopback.py
+++ b/workspace/wifi_loopback_noGUI.py
@@ -2,8 +2,8 @@
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
-# Title: Wifi Loopback
-# Generated: Sat Oct 31 12:11:06 2015
+# Title: Wifi Loopback Nogui
+# Generated: Tue Nov 3 15:44:35 2015
##################################################
import os
@@ -24,19 +24,19 @@ import math
import pmt
-class wifi_loopback(gr.top_block):
+class wifi_loopback_noGUI(gr.top_block):
- def __init__(self, chan_est=1, encoding=0, freq_offset=0, pdu_length=500, snr=10, interval=500):
- gr.top_block.__init__(self, "Wifi Loopback")
+ def __init__(self, nmessages=50, chan_est=1, snr=10, freq_offset=0, encoding=0, interval=500):
+ gr.top_block.__init__(self, "Wifi Loopback Nogui")
##################################################
# Parameters
##################################################
+ self.nmessages = nmessages
self.chan_est = chan_est
- self.encoding = encoding
- self.freq_offset = freq_offset
- self.pdu_length = pdu_length
self.snr = snr
+ self.freq_offset = freq_offset
+ self.encoding = encoding
self.interval = interval
##################################################
@@ -51,8 +51,9 @@ class wifi_loopback(gr.top_block):
encoding=encoding,
chan_est=chan_est,
)
- self.ieee802_11_ofdm_parse_mac_0 = ieee802_11.ofdm_parse_mac(False, True)
self.ieee802_11_ofdm_mac_0 = ieee802_11.ofdm_mac(([0x23, 0x23, 0x23, 0x23, 0x23, 0x23]), ([0x42, 0x42, 0x42, 0x42, 0x42, 0x42]), ([0xff, 0xff, 0xff, 0xff, 0xff, 0xff]))
+ self.foo_wireshark_connector_0 = foo.wireshark_connector(127, False)
+ self.foo_periodic_msg_source_0 = foo.periodic_msg_source(pmt.intern("Hello World!"), interval, nmessages, True, False)
self.foo_packet_pad2_0 = foo.packet_pad2(False, False, 0.001, 500, 0)
(self.foo_packet_pad2_0).set_min_output_buffer(96000)
self.channels_channel_model_0 = channels.channel_model(
@@ -63,26 +64,32 @@ class wifi_loopback(gr.top_block):
noise_seed=0,
block_tags=False
)
- self.blocks_pdu_to_tagged_stream_0 = blocks.pdu_to_tagged_stream(blocks.float_t, "packet_len")
- self.blocks_null_sink_1 = blocks.null_sink(gr.sizeof_float*1)
self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_gr_complex*1)
self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vcc(((10**(snr/10.0))**.5, ))
- self.blocks_message_strobe_0 = blocks.message_strobe(pmt.intern("".join("x" for i in range(pdu_length))), interval)
+ self.blocks_file_sink_0_0 = blocks.file_sink(gr.sizeof_char*1, "/tmp/ofdm_n" + str(nmessages) + "_s" + str(snr) + "_e" + str(encoding) + "_i" + str(interval) + ".pcap", False)
+ self.blocks_file_sink_0_0.set_unbuffered(True)
##################################################
# Connections
##################################################
- self.msg_connect((self.blocks_message_strobe_0, 'strobe'), (self.ieee802_11_ofdm_mac_0, 'app in'))
+ self.msg_connect((self.foo_periodic_msg_source_0, 'out'), (self.foo_wireshark_connector_0, 'in'))
+ self.msg_connect((self.foo_periodic_msg_source_0, 'out'), (self.ieee802_11_ofdm_mac_0, 'app in'))
self.msg_connect((self.ieee802_11_ofdm_mac_0, 'phy out'), (self.wifi_phy_hier_0, 'mac_in'))
- self.msg_connect((self.ieee802_11_ofdm_parse_mac_0, 'fer'), (self.blocks_pdu_to_tagged_stream_0, 'pdus'))
- self.msg_connect((self.wifi_phy_hier_0, 'mac_out'), (self.ieee802_11_ofdm_parse_mac_0, 'in'))
+ self.msg_connect((self.wifi_phy_hier_0, 'mac_out'), (self.foo_wireshark_connector_0, 'in'))
self.connect((self.blocks_multiply_const_vxx_0, 0), (self.channels_channel_model_0, 0))
- self.connect((self.blocks_pdu_to_tagged_stream_0, 0), (self.blocks_null_sink_1, 0))
self.connect((self.channels_channel_model_0, 0), (self.wifi_phy_hier_0, 0))
self.connect((self.foo_packet_pad2_0, 0), (self.blocks_multiply_const_vxx_0, 0))
+ self.connect((self.foo_wireshark_connector_0, 0), (self.blocks_file_sink_0_0, 0))
self.connect((self.wifi_phy_hier_0, 1), (self.blocks_null_sink_0, 0))
self.connect((self.wifi_phy_hier_0, 0), (self.foo_packet_pad2_0, 0))
+ def get_nmessages(self):
+ return self.nmessages
+
+ def set_nmessages(self, nmessages):
+ self.nmessages = nmessages
+ self.blocks_file_sink_0_0.open("/tmp/ofdm_n" + str(self.nmessages) + "_s" + str(self.snr) + "_e" + str(self.encoding) + "_i" + str(self.interval) + ".pcap")
+
def get_chan_est(self):
return self.chan_est
@@ -90,12 +97,13 @@ class wifi_loopback(gr.top_block):
self.chan_est = chan_est
self.wifi_phy_hier_0.set_chan_est(self.chan_est)
- def get_encoding(self):
- return self.encoding
+ def get_snr(self):
+ return self.snr
- def set_encoding(self, encoding):
- self.encoding = encoding
- self.wifi_phy_hier_0.set_encoding(self.encoding)
+ def set_snr(self, snr):
+ self.snr = snr
+ self.blocks_multiply_const_vxx_0.set_k(((10**(self.snr/10.0))**.5, ))
+ self.blocks_file_sink_0_0.open("/tmp/ofdm_n" + str(self.nmessages) + "_s" + str(self.snr) + "_e" + str(self.encoding) + "_i" + str(self.interval) + ".pcap")
def get_freq_offset(self):
return self.freq_offset
@@ -104,26 +112,20 @@ class wifi_loopback(gr.top_block):
self.freq_offset = freq_offset
self.channels_channel_model_0.set_frequency_offset(self.freq_offset)
- def get_pdu_length(self):
- return self.pdu_length
+ def get_encoding(self):
+ return self.encoding
- def set_pdu_length(self, pdu_length):
- self.pdu_length = pdu_length
- self.blocks_message_strobe_0.set_msg(pmt.intern("".join("x" for i in range(self.pdu_length))))
-
- def get_snr(self):
- return self.snr
-
- def set_snr(self, snr):
- self.snr = snr
- self.blocks_multiply_const_vxx_0.set_k(((10**(self.snr/10.0))**.5, ))
+ def set_encoding(self, encoding):
+ self.encoding = encoding
+ self.wifi_phy_hier_0.set_encoding(self.encoding)
+ self.blocks_file_sink_0_0.open("/tmp/ofdm_n" + str(self.nmessages) + "_s" + str(self.snr) + "_e" + str(self.encoding) + "_i" + str(self.interval) + ".pcap")
def get_interval(self):
return self.interval
def set_interval(self, interval):
self.interval = interval
- self.blocks_message_strobe_0.set_period(self.interval)
+ self.blocks_file_sink_0_0.open("/tmp/ofdm_n" + str(self.nmessages) + "_s" + str(self.snr) + "_e" + str(self.encoding) + "_i" + str(self.interval) + ".pcap")
def get_out_buf_size(self):
return self.out_buf_size
@@ -135,37 +137,32 @@ class wifi_loopback(gr.top_block):
def argument_parser():
parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
parser.add_option(
- "", "--chan-est", dest="chan_est", type="intx", default=1,
+ "-n", "--nmessages", dest="nmessages", type="intx", default=50,
+ help="Set nmessages [default=%default]")
+ parser.add_option(
+ "-c", "--chan-est", dest="chan_est", type="intx", default=1,
help="Set chan_est [default=%default]")
parser.add_option(
- "", "--encoding", dest="encoding", type="intx", default=0,
- help="Set encoding [default=%default]")
- parser.add_option(
- "", "--freq-offset", dest="freq_offset", type="eng_float", default=eng_notation.num_to_str(0),
- help="Set freq_offset [default=%default]")
- parser.add_option(
- "", "--pdu-length", dest="pdu_length", type="intx", default=500,
- help="Set pdu_length [default=%default]")
- parser.add_option(
- "", "--snr", dest="snr", type="eng_float", default=eng_notation.num_to_str(10),
+ "-s", "--snr", dest="snr", type="eng_float", default=eng_notation.num_to_str(10),
help="Set snr [default=%default]")
parser.add_option(
- "", "--interval", dest="interval", type="intx", default=500,
+ "-o", "--freq-offset", dest="freq_offset", type="eng_float", default=eng_notation.num_to_str(0),
+ help="Set freq_offset [default=%default]")
+ parser.add_option(
+ "-e", "--encoding", dest="encoding", type="intx", default=0,
+ help="Set encoding [default=%default]")
+ parser.add_option(
+ "-i", "--interval", dest="interval", type="intx", default=500,
help="Set interval [default=%default]")
return parser
-def main(top_block_cls=wifi_loopback, options=None):
+def main(top_block_cls=wifi_loopback_noGUI, options=None):
if options is None:
options, _ = argument_parser().parse_args()
- tb = top_block_cls(chan_est=options.chan_est, encoding=options.encoding, freq_offset=options.freq_offset, pdu_length=options.pdu_length, snr=options.snr, interval=options.interval)
+ tb = top_block_cls(nmessages=options.nmessages, chan_est=options.chan_est, snr=options.snr, freq_offset=options.freq_offset, encoding=options.encoding, interval=options.interval)
tb.start()
- try:
- raw_input('Press Enter to quit: ')
- except EOFError:
- pass
- tb.stop()
tb.wait()