Build C++ processing block that adds a preamble

Hello, I am trying to build my own block. The block should operate as

  • The block receive the sequence of the input stream.
  • The block divides the input sequence in blocks of d_pkt_len elements,
    a predefined value of packet length (unsigned int d_pkt_len), and attach
    to the beginning of the sequence a word of specified length of samples
    (unsigned int d_sync_word_len).
  • In this example the word is set to be just 0’s for simplicity.
    d_pkt_len and d_sync_word_len are meant to be input parameters in the
    final block.

For instance, if input is (1,1,1,1,1,1) and d_pkt_len=6,
d_sync_word_len=4, the output should be (0,0,0,0,1,1,1,1,1,1).
If input is (1,1,1,1,1,1) and d_pkt_len=3, d_sync_word_len=4, the output
should be (0,0,0,0,1,1,1,0,0,0,0,1,1,1).

This was a bit confusing for me when it came to code forecast function,
since, the output number of items really depends on the input and the
parameter d_pkt_len. I used set_output_multiple().

The issue is, I built the block, and one of the tests failed. Giving me
the following error:

build$ ctest -V -R
UpdateCTestConfiguration from
UpdateCTestConfiguration from
Test project /home/comlab/Desktop/Gabri/mimo/gr-sync/build
Constructing a list of tests
Done constructing a list of tests
Checking test dependency graph…
Checking test dependency graph end
test 1
Start 1: test_sync

1: Test command: /bin/sh
1: Test timeout computed to be: 9.99988e+06
1/2 Test #1: test_sync … Passed 0.00 sec
test 2
Start 2: qa_sync_ff

2: Test command: /bin/sh
2: Test timeout computed to be: 9.99988e+06
2: thread[thread-per-block[1]: <block sync_ff (0)>]: pmt_dict_keys:
wrong_type : #
2: thread[thread-per-block[1]: <block sync_ff (1)>]: pmt_dict_keys:
wrong_type : #
2: F

2: FAIL: test_001_t (main.qa_sync_ff)

2: Traceback (most recent call last):
2: File
“/home/comlab/Desktop/Gabri/mimo/gr-sync/python/”, line 47,
in test_001_t
2: self.assertFloatTuplesAlmostEqual(expected_result, result_data,
2: File
“/usr/local/lib/python2.7/dist-packages/gnuradio/”, line
88, in assertFloatTuplesAlmostEqual
2: self.assertEqual (len(a), len(b))
2: AssertionError: 10 != 0

2: Ran 1 test in 0.264s
2: FAILED (failures=1)
2/2 Test #2: qa_sync_ff …***Failed 0.43 sec

50% tests passed, 1 tests failed out of 2

Total Test time (real) = 0.43 sec

The following tests FAILED:
2 - qa_sync_ff (Failed)
Errors while running CTest

I was trying to get some info from this, but I wasn’t able so far. In
addition I tried to make the xml file just to try it in
GNURadio-Companion but It gave me error, I guess it has to be with the
test error. If anyone is able to help me or give me some tip to fix that
it would be very nice. I have spent so much time in this simple block. I
attach the, sync_ff_impl.c and files.

Thanks in advance.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs