Packet-based communication & underrun / Possible solution?

I want a gnu radio application that send packets (messages) in AIR when
pressing ENTER with USRP. Since i don’t want any underun on USRP side, i
need a block that send zero-filled packets when there’s no data to send.
I solved it with a modify of message_source block.
Instead of call delete->head() and wait for a message, i check if
there’s a
new message to send with empty_p(). If there isn’t, then zero-fill the
data
(to the USRP)

The code
//my code
if (d_msgq->empty_p())
{
memset (out, 0, noutput_items*d_itemsize);
return noutput_items;
}
// end of my code

  d_msg = d_msgq->delete_head();  //blocking call
  d_msg_offset = 0;

It’s okay? There are other ways to do it better? Thank you.

Instead of call delete->head() and wait for a message

It’s not “instead”. Before calling it i check if there’s an empty queue.

2011/10/26 Mattia R. [email protected]