discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] USRP2 rx handler chunk size


From: Gaetano Mendola
Subject: [Discuss-gnuradio] USRP2 rx handler chunk size
Date: Fri, 17 Sep 2010 21:14:10 +0200

Hi all,
I'm observing that rx handlers are called when 371 samples are ready,
I thought (I don't remember why
I have 370 hard coded in my code) the chunks where 370 samples. Has
this changed lately or it has been
always like this?
Is there a way to know in advance with how many samples the
rx_handlers are called each time?

Also, I have a question about the rx handlers implemented usage
pattern. I have understood how to use it,
and I find it a bit dangerous. In the documentation I read, about
usrp2::rx_nop_handler::operator()

"Function operator invoked by USRP2 RX API. Derived classes must
override this method but then invoke
it at the start of their processing. This operator will always be
called at least once."

Why rely on the fact that user has to implement the operator() calling
the base class one first? Wouldn't have
been the same with this structure:

class rx_nop_handler : public rx_sample_handler
{
    ...
   virtual bool operator()(const uint32_t *items, size_t nitems, const
rx_metadata *metadata) {
       ...
       method_user_has_to_specify(items, nitems, metadata);
   }

   virtual bool method_user_has_to_specify(const uint32_t *items,
size_t nitems, const rx_metadata *metadata) = 0;
}

In this way USRP2 class calls operator()(...) on the handler that
doesn't do dynamic binding on user defined handler, but then
rx_nop_handler::operator() after have done his stuff calls the
method_user_has_to_specify. Same effect of actual structure but
without relying on the user to behave nicely.


Regards
Gaetano Mendola

-- 
cpp-today.blogspot.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]