0

I have an external device, which sends UDP unicast packet of size 556 bytes. I need to transform each packet to vector of size 270 with uint16 inside. And then I'd like to plot this waveform as time-domain data. Here is a c++ code to do this tranformation :

 std::vector<boost::uint8_t> rxPacket(BUFFSIZE*sizeof(std::int16_t) + UPP_TAIL_SIZE_IN_BYTES, 0);

 udpBuffer->pop_back(rxPacket);

 std::vector<boost::int16_t> rx_data(BUFFSIZE, 0);

 memcpy(&rx_data[0], &rxPacket[0], BUFFSIZE*sizeof(std::int16_t));

How to do this using GNU Radio Companion? What block do I have to use to achieve this kind of transformation?

Dmitry
  • 1,912
  • 2
  • 18
  • 29

1 Answers1

1

Nothing; you literally don't need to do anything – GNU Radio doesn't care about the actual data type, just the memory size of items.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
  • Do you mean that I should put 540 as the size of payload for UDP source block and that’s it ? Would it skip the rest 16 bytes of each frame automatically ? – Dmitry Nov 08 '19 at 04:04
  • 1
    you could solve that with a "patterned deinterleaver" block that GNU Radio delivers. Alternatively: [Write your own block](https://wiki.gnuradio.org/index.php/Tutorials) That does exactly what you need. – Marcus Müller Nov 08 '19 at 11:36