summaryrefslogtreecommitdiff
path: root/gr-blocks/lib/random_pdu_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gr-blocks/lib/random_pdu_impl.cc')
-rw-r--r--gr-blocks/lib/random_pdu_impl.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/gr-blocks/lib/random_pdu_impl.cc b/gr-blocks/lib/random_pdu_impl.cc
index 75d825aefa..4d847fc25c 100644
--- a/gr-blocks/lib/random_pdu_impl.cc
+++ b/gr-blocks/lib/random_pdu_impl.cc
@@ -45,8 +45,6 @@ random_pdu_impl::random_pdu_impl(int min_items,
: block("random_pdu", io_signature::make(0, 0, 0), io_signature::make(0, 0, 0)),
d_urange(min_items, max_items),
d_brange(0, 255),
- d_rvar(d_rng, d_urange),
- d_bvar(d_rng, d_brange),
d_mask(byte_mask),
d_length_modulo(length_modulo)
{
@@ -69,13 +67,13 @@ bool random_pdu_impl::start()
void random_pdu_impl::output_random()
{
// pick a random vector length
- int len = d_rvar();
+ int len = d_urange(d_rng);
len = std::max(d_length_modulo, len - len % d_length_modulo);
// fill it with random bytes
std::vector<unsigned char> vec(len);
for (int i = 0; i < len; i++)
- vec[i] = ((unsigned char)d_bvar()) & d_mask;
+ vec[i] = ((unsigned char)d_brange(d_rng)) & d_mask;
// send the vector
pmt::pmt_t vecpmt(pmt::make_blob(&vec[0], len));