diff options
Diffstat (limited to 'grc/grc_gnuradio/blks2/packet.py')
-rw-r--r-- | grc/grc_gnuradio/blks2/packet.py | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/grc/grc_gnuradio/blks2/packet.py b/grc/grc_gnuradio/blks2/packet.py index e39f55c841..cceb4da650 100644 --- a/grc/grc_gnuradio/blks2/packet.py +++ b/grc/grc_gnuradio/blks2/packet.py @@ -1,4 +1,4 @@ -# Copyright 2008, 2009 Free Software Foundation, Inc. +# Copyright 2008, 2009, 2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -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 @@ -158,7 +164,7 @@ class packet_decoder(gr.hier_block2): #blocks msgq = gr.msg_queue(DEFAULT_MSGQ_LIMIT) #holds packets from the PHY correlator = digital.correlate_access_code_bb(self._access_code, self._threshold) - framer_sink = gr.framer_sink_1(msgq) + framer_sink = digital.framer_sink_1(msgq) #initialize hier2 gr.hier_block2.__init__( self, |