summaryrefslogtreecommitdiff
path: root/gr-digital/include/gnuradio/digital/packet_header_default.h
diff options
context:
space:
mode:
Diffstat (limited to 'gr-digital/include/gnuradio/digital/packet_header_default.h')
-rw-r--r--gr-digital/include/gnuradio/digital/packet_header_default.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/gr-digital/include/gnuradio/digital/packet_header_default.h b/gr-digital/include/gnuradio/digital/packet_header_default.h
index 0654a32a63..6567dd7626 100644
--- a/gr-digital/include/gnuradio/digital/packet_header_default.h
+++ b/gr-digital/include/gnuradio/digital/packet_header_default.h
@@ -25,6 +25,7 @@
#include <gnuradio/tags.h>
#include <gnuradio/digital/api.h>
#include <boost/enable_shared_from_this.hpp>
+#include <boost/crc.hpp>
namespace gr {
namespace digital {
@@ -69,12 +70,15 @@ namespace gr {
*
* Uses the following header format:
* Bits 0-11: The packet length (what was stored in the tag with key \p len_tag_key)
- * Bits 12-27: The header number (counts up everytime this function is called)
- * Bit 28: Even parity bit
+ * Bits 12-23: The header number (counts up everytime this function is called)
+ * Bit 24-31: 8-Bit CRC
* All other bits: Are set to zero
*
- * If the header length is smaller than 29, bits are simply left out. For this
+ * If the header length is smaller than 32, bits are simply left out. For this
* reason, they always start with the LSB.
+ *
+ * However, it is recommended to stay above 32 Bits, in order to have a working
+ * CRC.
*/
virtual bool header_formatter(
long packet_len,
@@ -104,6 +108,7 @@ namespace gr {
int d_bits_per_byte;
unsigned d_header_number;
unsigned d_mask;
+ boost::crc_optimal<8, 0x07, 0xFF, 0x00, false, false> d_crc_impl;
};
} // namespace digital