summaryrefslogtreecommitdiff
path: root/gr-digital/python/digital/packet_utils.py
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2014-05-16 12:16:07 -0400
committerTom Rondeau <tom@trondeau.com>2014-05-17 17:45:16 -0400
commitf23b3106cd2c73be3708c29dc85afb37298d4731 (patch)
tree764fd7d952c6196f4f8fa252f08f1d3a776cfb47 /gr-digital/python/digital/packet_utils.py
parent03b3b0eb63232507a4837be38d0398a655284f69 (diff)
digital: added option to packet_utils.unmake_packet to check or not check the CRC.
Diffstat (limited to 'gr-digital/python/digital/packet_utils.py')
-rw-r--r--gr-digital/python/digital/packet_utils.py12
1 files changed, 10 insertions, 2 deletions
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)