Forum: GNU Radio Details on USB buffer

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
80ead9cba42f1fb22b365661020f8eec?d=identicon&s=25 Tony (Guest)
on 2009-02-27 01:06
(Received via mailing list)
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 
745d8202ef5a58c1058d0e5395a78f9c?d=identicon&s=25 Eric Blossom (Guest)
on 2009-02-27 09:28
(Received via mailing list)
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
A725014f091bcd9e8ff16e9f2a0d7e20?d=identicon&s=25 Stefan Bruens (Guest)
on 2009-02-27 12:44
(Received via mailing list)
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
This topic is locked and can not be replied to.