summaryrefslogtreecommitdiff
path: root/gr-blocks/lib/unpack_k_bits.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gr-blocks/lib/unpack_k_bits.cc')
-rw-r--r--gr-blocks/lib/unpack_k_bits.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/gr-blocks/lib/unpack_k_bits.cc b/gr-blocks/lib/unpack_k_bits.cc
index f274cf5b60..a9ae4dae11 100644
--- a/gr-blocks/lib/unpack_k_bits.cc
+++ b/gr-blocks/lib/unpack_k_bits.cc
@@ -55,6 +55,17 @@ namespace gr {
}
}
+ void
+ unpack_k_bits::unpack_rev(unsigned char *bits, const unsigned char *bytes, int nbytes) const
+ {
+ int n = 0;
+ for(int i = 0; i < nbytes; i++) {
+ unsigned int t = bytes[i];
+ for(int j = 0; j < d_k; j++)
+ bits[n++] = (t >> j) & 0x01;
+ }
+ }
+
int
unpack_k_bits::k() const
{