3 * Copyright 2008 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
27 #include <usrp2_sink_32fc.h>
28 #include <usrp2/metadata.h>
29 #include <gr_io_signature.h>
33 usrp2_make_sink_32fc(const std::string &ifc, const std::string &mac_addr)
34 throw (std::runtime_error)
36 return gnuradio::get_initial_sptr(new usrp2_sink_32fc(ifc, mac_addr));
39 usrp2_sink_32fc::usrp2_sink_32fc(const std::string &ifc, const std::string &mac_addr)
40 throw (std::runtime_error)
41 : usrp2_sink_base("usrp2_sink_32fc",
42 gr_make_io_signature(1, 1, sizeof(gr_complex)),
48 usrp2_sink_32fc::~usrp2_sink_32fc()
54 usrp2_sink_32fc::work(int noutput_items,
55 gr_vector_const_void_star &input_items,
56 gr_vector_void_star &output_items)
58 gr_complex *in = (gr_complex *)input_items[0];
60 usrp2::tx_metadata metadata;
61 metadata.timestamp = -1;
62 metadata.send_now = 1;
63 metadata.start_of_burst = 1;
65 bool ok = d_u2->tx_32fc(0, // FIXME: someday, streams will have channel numbers
66 in, noutput_items, &metadata);
68 std::cerr << "usrp2_sink_32fc: tx_32fc failed" << std::endl;
69 return -1; // say we're done