commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 43/57: digital: added option to packet_util


From: git
Subject: [Commit-gnuradio] [gnuradio] 43/57: digital: added option to packet_utils.unmake_packet to check or not check the CRC.
Date: Wed, 21 May 2014 03:10:30 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

trondeau pushed a commit to branch master
in repository gnuradio.

commit f23b3106cd2c73be3708c29dc85afb37298d4731
Author: Tom Rondeau <address@hidden>
Date:   Fri May 16 12:16:07 2014 -0400

    digital: added option to packet_utils.unmake_packet to check or not check 
the CRC.
---
 gr-digital/python/digital/packet_utils.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/gr-digital/python/digital/packet_utils.py 
b/gr-digital/python/digital/packet_utils.py
index efb3252..a73480b 100644
--- a/gr-digital/python/digital/packet_utils.py
+++ b/gr-digital/python/digital/packet_utils.py
@@ -182,12 +182,16 @@ def _npadding_bytes(pkt_byte_len, samples_per_symbol, 
bits_per_symbol):
     return byte_modulus - r
 
 
-def unmake_packet(whitened_payload_with_crc, whitener_offset=0, 
dewhitening=True):
+def unmake_packet(whitened_payload_with_crc, whitener_offset=0,
+                  dewhitening=True, check_crc=True):
     """
     Return (ok, payload)
 
     Args:
         whitened_payload_with_crc: string
+        whitener_offset: integer offset into whitener table
+        dewhitening: True if we should run this through the dewhitener
+        check_crc: True if we should check the CRC of the packet
     """
 
     if dewhitening:
@@ -195,7 +199,11 @@ def unmake_packet(whitened_payload_with_crc, 
whitener_offset=0, dewhitening=True
     else:
         payload_with_crc = (whitened_payload_with_crc)
 
-    ok, payload = crc.check_crc32(payload_with_crc)
+    if check_crc:
+        ok, payload = crc.check_crc32(payload_with_crc)
+    else:
+        payload = payload_with_crc
+        ok = True
 
     if 0:
         print "payload_with_crc =", string_to_hex_list(payload_with_crc)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]