*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <rx_16sc_handler.h>
rx_16sc_handler::~rx_16sc_handler()
{
+ // NOP
}
#include <usrp2/rx_nop_handler.h>
#include <usrp2/copiers.h>
-#define RX_16SC_HANDLER_DEBUG 0
-
class rx_16sc_handler : public usrp2::rx_nop_handler
{
std::complex<int16_t> *d_dest;
// Factory function to return a shared pointer to a new instance
static sptr make(uint64_t max_samples, uint64_t max_quantum, std::complex<int16_t> *dest)
{
- if (RX_16SC_HANDLER_DEBUG)
- printf("rx_16sc_handler: max_samples=%li max_quantum=%li\n", max_samples, max_quantum);
-
return sptr(new rx_16sc_handler(max_samples, max_quantum, dest));
}
// Invoked by USRP2 API when samples are available
bool operator()(const uint32_t *items, size_t nitems, const usrp2::rx_metadata *metadata)
{
- if (RX_16SC_HANDLER_DEBUG)
- printf("rx_16sc_handler: called with items=%zu ", nitems);
-
// Copy/reformat/endian swap USRP2 data to destination buffer
usrp2::copy_u2_16sc_to_host_16sc(nitems, items, d_dest);
d_dest += nitems;
// FIXME: do something with metadata
- // Determine if there is room to be called again
- bool ok = rx_nop_handler::operator()(items, nitems, metadata);
- if (RX_16SC_HANDLER_DEBUG)
- printf("ok to call again=%i\n", ok);
-
- return ok;
+ // Call parent to determine if there is room to be called again
+ return rx_nop_handler::operator()(items, nitems, metadata);
}
~rx_16sc_handler();
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <rx_32fc_handler.h>
rx_32fc_handler::~rx_32fc_handler()
{
+ // NOP
}
#include <usrp2/copiers.h>
#include <gr_complex.h>
-#define RX_32FC_HANDLER_DEBUG 0
-
class rx_32fc_handler : public usrp2::rx_nop_handler
{
gr_complex *d_dest;
// Factory function to return a shared pointer to a new instance
static sptr make(uint64_t max_samples, uint64_t max_quantum, gr_complex *dest)
{
- if (RX_32FC_HANDLER_DEBUG)
- printf("rx_32fc_handler: max_samples=%li max_quantum=%li\n", max_samples, max_quantum);
-
return sptr(new rx_32fc_handler(max_samples, max_quantum, dest));
}
// Invoked by USRP2 API when samples are available
bool operator()(const uint32_t *items, size_t nitems, const usrp2::rx_metadata *metadata)
{
- if (RX_32FC_HANDLER_DEBUG)
- printf("rx_32fc_handler: called with items=%zu ", nitems);
-
// Copy/reformat/endian swap USRP2 data to destination buffer
usrp2::copy_u2_16sc_to_host_32fc(nitems, items, d_dest);
d_dest += nitems;
// FIXME: do something with metadata
- // Determine if there is room to be called again
- bool ok = rx_nop_handler::operator()(items, nitems, metadata);
- if (RX_32FC_HANDLER_DEBUG)
- printf("ok to call again=%i\n", ok);
-
- return ok;
+ // Call parent to determine if there is room to be called again
+ return rx_nop_handler::operator()(items, nitems, metadata);
}
~rx_32fc_handler();
public:
~usrp2_source_16sc();
-
- std::string mac_addr();
};
// ----------------------------------------------------------------
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <usrp2_base.h>
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <usrp2_sink_16sc.h>
metadata.send_now = 1;
metadata.start_of_burst = 1;
- bool ok = d_u2->tx_16sc(0, // FIXME: someday, streams will have channel numbers
+ bool ok = d_u2->tx_16sc(0, // FIXME: use channel number instead of 0
in, noutput_items, &metadata);
if (!ok){
- std::cerr << "usrp2_sink_16sc: tx_complex_int16 failed" << std::endl;
+ std::cerr << "usrp2_sink_16sc: tx_16sc failed" << std::endl;
return -1; // say we're done
}
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <usrp2_sink_32fc.h>
metadata.send_now = 1;
metadata.start_of_burst = 1;
- bool ok = d_u2->tx_32fc(0, // FIXME: someday, streams will have channel numbers
+ bool ok = d_u2->tx_32fc(0, // FIXME: use channel number instead of 0
in, noutput_items, &metadata);
if (!ok){
std::cerr << "usrp2_sink_32fc: tx_32fc failed" << std::endl;
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <usrp2_sink_base.h>
#include <gr_io_signature.h>
#include <iostream>
-#define USRP2_SINK_BASE_DEBUG 0
-
usrp2_sink_base::usrp2_sink_base(const char *name,
gr_io_signature_sptr input_signature,
const std::string &ifc,
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <usrp2_source_16sc.h>
usrp2_source_16sc::~usrp2_source_16sc()
{
+ // NOP
}
int
rx_16sc_handler::sptr handler = rx_16sc_handler::make(noutput_items, USRP2_MIN_RX_SAMPLES, out);
- bool ok = d_u2->rx_samples(0, handler.get());
+ bool ok = d_u2->rx_samples(0, handler.get()); // FIXME: channel number instead of 0
if (!ok){
std::cerr << "usrp2::rx_samples() failed" << std::endl;
return -1; // say we're done
* Boston, MA 02110-1301, USA.
*/
-#ifndef INCLUDED_USRP2_SOURCE_C_H
-#define INCLUDED_USRP2_SOURCE_C_H
+#ifndef INCLUDED_USRP2_SOURCE_16SC_H
+#define INCLUDED_USRP2_SOURCE_16SC_H
#include <usrp2_source_base.h>
usrp2_source_32fc::~usrp2_source_32fc()
{
+ // NOP
}
int
rx_32fc_handler::sptr handler = rx_32fc_handler::make(noutput_items, USRP2_MIN_RX_SAMPLES, out);
- bool ok = d_u2->rx_samples(0, handler.get());
+ bool ok = d_u2->rx_samples(0, handler.get()); // FIXME: channel number instead of 0
if (!ok){
std::cerr << "usrp2::rx_samples() failed" << std::endl;
return -1; // say we're done
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <usrp2_source_base.h>