From f23b3106cd2c73be3708c29dc85afb37298d4731 Mon Sep 17 00:00:00 2001
From: Tom Rondeau <tom@trondeau.com>
Date: Fri, 16 May 2014 12:16:07 -0400
Subject: 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(-)

(limited to 'gr-digital/python/digital/packet_utils.py')

diff --git a/gr-digital/python/digital/packet_utils.py b/gr-digital/python/digital/packet_utils.py
index efb3252b14..a73480bdcb 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)
-- 
cgit v1.2.3