[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuradio-commit
Subject:    [Commit-gnuradio] gnuradio-core/src/python/gnuradio packet_utils.py
From:       "Thomas W. Rondeau" <trondeau () vt ! edu>
Date:       2006-06-28 21:38:01
Message-ID: E1FvhjV-0000JK-7H () savannah ! gnu ! org
[Download RAW message or body]

CVSROOT:	/sources/gnuradio
Module name:	gnuradio-core
Changes by:	Thomas W. Rondeau <trondeau1122>	06/06/28 21:38:01

Modified files:
	src/python/gnuradio: packet_utils.py 

Log message:
	added a correction for the number of bits/baud to properly pad for USB transmission

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnuradio-core/src/python/gnuradio/packet_utils.py?cvsroot=gnuradio&r1=1.9&r2=1.10


Patches:
Index: packet_utils.py
===================================================================
RCS file: /sources/gnuradio/gnuradio-core/src/python/gnuradio/packet_utils.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- packet_utils.py	20 Jun 2006 22:24:32 -0000	1.9
+++ packet_utils.py	28 Jun 2006 21:38:01 -0000	1.10
@@ -129,12 +129,12 @@
 
     pkt = ''.join((packed_access_code, make_header(L), whiten(payload_with_crc), \
'\x55'))  if pad_for_usrp:
-        pkt = pkt + (_npadding_bytes(len(pkt), spb) * '\x55')
+        pkt = pkt + (_npadding_bytes(len(pkt), spb, bits_per_baud) * '\x55')
 
     #print "make_packet: len(pkt) =", len(pkt)
     return pkt
 
-def _npadding_bytes(pkt_byte_len, spb):
+def _npadding_bytes(pkt_byte_len, spb, bits_per_baud):
     """
     Generate sufficient padding such that each packet ultimately ends
     up being a multiple of 512 bytes when sent across the USB.  We
@@ -149,7 +149,7 @@
     @returns number of bytes of padding to append.
     """
     modulus = 128
-    byte_modulus = gru.lcm(modulus/8, spb) / spb
+    byte_modulus = gru.lcm(modulus/8, spb) * bits_per_baud / spb
     r = pkt_byte_len % byte_modulus
     if r == 0:
         return 0


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic