The USRP C++ example program uses this code to move USRP USB data into a
buffer:
     urx->read(&buf, bufsize, &overrun);
If this line is called many times in a short period of time will the
buffer have some of the data leftover from previous read(s)? Can I
assume that the OS will not return the buffer until the next n bytes
have been received?
On Thu, Feb 26, 2009 at 04:05:52PM -0800, Tony wrote:
The USRP C++ example program uses this code to move USRP USB data into a buffer:
urx->read(&buf, bufsize, &overrun);
If this line is called many times in a short period of time will the
buffer have some of the data leftover from previous read(s)? Can I
assume that the OS will not return the buffer until the next n bytes
have been received?
Tony
The read is a blocking read. The return value is the number of bytes
actually
read, which will always be the same as bufsize or an error value (<0).
Samples
may be thrown away in the USRP itself this is called an overrun, in this
case
the corresponding variable will be set to true.