Details on USB buffer

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Â

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?

It doesn’t lose or throw any data away.

Eric

On Friday 27 February 2009 01:05:52 Tony wrote:

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.

Stefan


Stefan Brüns / Bergstraße 21 / 52062 Aachen
phone: +49 241 53809034 mobile: +49 151 50412019