summaryrefslogtreecommitdiff
path: root/grc/grc_gnuradio
diff options
context:
space:
mode:
Diffstat (limited to 'grc/grc_gnuradio')
-rw-r--r--grc/grc_gnuradio/blks2/error_rate.py8
-rw-r--r--grc/grc_gnuradio/blks2/packet.py24
-rw-r--r--grc/grc_gnuradio/blks2/selector.py34
-rw-r--r--grc/grc_gnuradio/blks2/tcp.py12
4 files changed, 51 insertions, 27 deletions
diff --git a/grc/grc_gnuradio/blks2/error_rate.py b/grc/grc_gnuradio/blks2/error_rate.py
index 9b2df58ef1..eb8d12d4e3 100644
--- a/grc/grc_gnuradio/blks2/error_rate.py
+++ b/grc/grc_gnuradio/blks2/error_rate.py
@@ -62,9 +62,11 @@ class error_rate(gr.hier_block2):
def __init__(self, type='BER', win_size=default_win_size, bits_per_symbol=2):
"""
Error rate constructor.
- @param type a string 'BER' or 'SER'
- @param win_size the number of samples to calculate over
- @param bits_per_symbol the number of information bits per symbol (BER only)
+
+ Args:
+ type: a string 'BER' or 'SER'
+ win_size: the number of samples to calculate over
+ bits_per_symbol: the number of information bits per symbol (BER only)
"""
#init
gr.hier_block2.__init__(
diff --git a/grc/grc_gnuradio/blks2/packet.py b/grc/grc_gnuradio/blks2/packet.py
index 494afa986a..cceb4da650 100644
--- a/grc/grc_gnuradio/blks2/packet.py
+++ b/grc/grc_gnuradio/blks2/packet.py
@@ -70,11 +70,13 @@ class packet_encoder(gr.hier_block2):
def __init__(self, samples_per_symbol, bits_per_symbol, access_code='', pad_for_usrp=True):
"""
packet_mod constructor.
- @param samples_per_symbol number of samples per symbol
- @param bits_per_symbol number of bits per symbol
- @param access_code AKA sync vector
- @param pad_for_usrp If true, packets are padded such that they end up a multiple of 128 samples
- @param payload_length number of bytes in a data-stream slice
+
+ Args:
+ samples_per_symbol: number of samples per symbol
+ bits_per_symbol: number of bits per symbol
+ access_code: AKA sync vector
+ pad_for_usrp: If true, packets are padded such that they end up a multiple of 128 samples
+ payload_length: number of bytes in a data-stream slice
"""
#setup parameters
self._samples_per_symbol = samples_per_symbol
@@ -102,7 +104,9 @@ class packet_encoder(gr.hier_block2):
def send_pkt(self, payload):
"""
Wrap the payload in a packet and push onto the message queue.
- @param payload string, data to send
+
+ Args:
+ payload: string, data to send
"""
packet = packet_utils.make_packet(
payload,
@@ -142,9 +146,11 @@ class packet_decoder(gr.hier_block2):
def __init__(self, access_code='', threshold=-1, callback=None):
"""
packet_demod constructor.
- @param access_code AKA sync vector
- @param threshold detect access_code with up to threshold bits wrong (0 -> use default)
- @param callback a function of args: ok, payload
+
+ Args:
+ access_code: AKA sync vector
+ threshold: detect access_code with up to threshold bits wrong (0 -> use default)
+ callback: a function of args: ok, payload
"""
#access code
if not access_code: #get access code
diff --git a/grc/grc_gnuradio/blks2/selector.py b/grc/grc_gnuradio/blks2/selector.py
index f0f6d5dd7a..f6a8aa79b1 100644
--- a/grc/grc_gnuradio/blks2/selector.py
+++ b/grc/grc_gnuradio/blks2/selector.py
@@ -26,11 +26,13 @@ class selector(gr.hier_block2):
def __init__(self, item_size, num_inputs, num_outputs, input_index, output_index):
"""
Selector constructor.
- @param item_size the size of the gr data stream in bytes
- @param num_inputs the number of inputs (integer)
- @param num_outputs the number of outputs (integer)
- @param input_index the index for the source data
- @param output_index the index for the destination data
+
+ Args:
+ item_size: the size of the gr data stream in bytes
+ num_inputs: the number of inputs (integer)
+ num_outputs: the number of outputs (integer)
+ input_index: the index for the source data
+ output_index: the index for the destination data
"""
gr.hier_block2.__init__(
self, 'selector',
@@ -54,7 +56,9 @@ class selector(gr.hier_block2):
def _indexes_valid(self):
"""
Are the input and output indexes within range of the number of inputs and outputs?
- @return true if input index and output index are in range
+
+ Returns:
+ true if input index and output index are in range
"""
return self.input_index in range(self.num_inputs) and self.output_index in range(self.num_outputs)
@@ -84,7 +88,9 @@ class selector(gr.hier_block2):
def set_input_index(self, input_index):
"""
Change the block to the new input index if the index changed.
- @param input_index the new input index
+
+ Args:
+ input_index: the new input index
"""
if self.input_index != input_index:
self.lock()
@@ -96,7 +102,9 @@ class selector(gr.hier_block2):
def set_output_index(self, output_index):
"""
Change the block to the new output index if the index changed.
- @param output_index the new output index
+
+ Args:
+ output_index: the new output index
"""
if self.output_index != output_index:
self.lock()
@@ -111,8 +119,10 @@ class valve(selector):
def __init__(self, item_size, open):
"""
Constructor for valve.
- @param item_size the size of the gr data stream in bytes
- @param open true if initial valve state is open
+
+ Args:
+ item_size: the size of the gr data stream in bytes
+ open: true if initial valve state is open
"""
if open: output_index = -1
else: output_index = 0
@@ -121,7 +131,9 @@ class valve(selector):
def set_open(self, open):
"""
Callback to set open state.
- @param open true to set valve state to open
+
+ Args:
+ open: true to set valve state to open
"""
if open: output_index = -1
else: output_index = 0
diff --git a/grc/grc_gnuradio/blks2/tcp.py b/grc/grc_gnuradio/blks2/tcp.py
index c6739b711e..dfebfcc2e6 100644
--- a/grc/grc_gnuradio/blks2/tcp.py
+++ b/grc/grc_gnuradio/blks2/tcp.py
@@ -28,10 +28,14 @@ def _get_sock_fd(addr, port, server):
Get the file descriptor for the socket.
As a client, block on connect, dup the socket descriptor.
As a server, block on accept, dup the client descriptor.
- @param addr the ip address string
- @param port the tcp port number
- @param server true for server mode, false for client mode
- @return the file descriptor number
+
+ Args:
+ addr: the ip address string
+ port: the tcp port number
+ server: true for server mode, false for client mode
+
+ Returns:
+ the file descriptor number
"""
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
if server: