Hello,

I'm a little confused on how to use the scrambler and descrambler, it looks
like the descrambler always preprends a byte to my stream.  When I run this
flowgraph I get this from the message ports (the first message is the
original message, the second message is from the descrambler):

* MESSAGE DEBUG PRINT PDU VERBOSE *
()
pdu_length = 10
contents =
0000: d0 22 e7 d5 20 f8 e9 38 a1 4e
***********************************
* MESSAGE DEBUG PRINT PDU VERBOSE *
()
pdu_length = 10
contents =
0000: 06 d0 22 e7 d5 20 f8 e9 38 a1
***********************************


I'm not totally sure what do about this, I've tried adding a delay block
but that screws up my packet_len tags.

Here's the original work function:

{
const unsigned char *in = (const unsigned char*)input_items[0];
unsigned char *out = (unsigned char*)output_items[0];

for(int i = 0; i < noutput_items; i++) {
    out[i] = d_lfsr.next_bit_descramble(in[i]);
}

return noutput_items;
}

I've also tried this work function (my approach here is to ignore the first
byte out of the descrambler and then put junk into the last byte which
would then be ignored on the next call to work() and yes I realize this
isn't a general solution)

{
const unsigned char *in = (const unsigned char*)input_items[0];
unsigned char *out = (unsigned char*)output_items[0];

      unsigned char junk;
      for(int i = 0; i < noutput_items + 8; i++) {
          if (i < 8) {
            junk = d_lfsr.next_bit_descramble(in[i]);
          } else if (i > noutput_items) {
            out[i - 8] = d_lfsr.next_bit_descramble(0xff);
          } else {
            out[i - 8] = d_lfsr.next_bit_descramble(in[i]);
          }
      }

return noutput_items;
}

I run the flowgraph and now my last byte is junk (argh!)


***********************************
* MESSAGE DEBUG PRINT PDU VERBOSE *
()
pdu_length = 10
contents =
0000: d0 22 e7 d5 20 f8 e9 38 a1 4e
***********************************
* MESSAGE DEBUG PRINT PDU VERBOSE *
()
pdu_length = 10
contents =
0000: d0 22 e7 d5 20 f8 e9 38 a1 3d

Does anyone have any advice on how to use to the scrambler and
descrambler?  Would writing my own message blocks that use the LFSR be a
better approach?

Thanks for any help,
Devin
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to