Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Commit

Permalink
Added 'Force' parameter to Check CRC32 block
Browse files Browse the repository at this point in the history
This parameter forces a check of the CRC32 even if the CRC flag in
the header is set to false. This is useful because several satellites
use CRC32 but set the flag to false.
  • Loading branch information
daniestevez committed Jan 1, 2017
1 parent 871499b commit 8d9602e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
17 changes: 16 additions & 1 deletion grc/csp_check_crc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<key>csp_check_crc</key>
<category>csp</category>
<import>import csp</import>
<make>csp.check_crc($include_header, $verbose)</make>
<make>csp.check_crc($include_header, $verbose, $force)</make>
<param>
<name>Include header</name>
<key>include_header</key>
Expand Down Expand Up @@ -33,6 +33,21 @@
</option>
</param>

<param>
<name>Force</name>
<key>force</key>
<value>False</value>
<type>bool</type>
<option>
<name>Yes</name>
<key>True</key>
</option>
<option>
<name>No</name>
<key>False</key>
</option>
</param>

<sink>
<name>in</name>
<type>message</type>
Expand Down
5 changes: 3 additions & 2 deletions python/check_crc.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ class check_crc(gr.basic_block):
"""
docstring for block check_crc
"""
def __init__(self, include_header, verbose):
def __init__(self, include_header, verbose, force=False):
gr.basic_block.__init__(self,
name="check_crc",
in_sig=[],
out_sig=[])

self.include_header = include_header
self.verbose = verbose
self.force = force

self.message_port_register_in(pmt.intern('in'))
self.set_msg_handler(pmt.intern('in'), self.handle_msg)
Expand All @@ -65,7 +66,7 @@ def handle_msg(self, msg_pmt):
if self.verbose:
print e
return
if not header.crc:
if not self.force and not header.crc:
if self.verbose:
print "CRC not used"
self.message_port_pub(pmt.intern('ok'), msg_pmt)
Expand Down

0 comments on commit 8d9602e

Please sign in to comment.