blob: eb0fc1307e1f5795598e4a0c2c39623129938f95 [file] [log] [blame]
Piotr Krysikc6eb3b52016-05-29 13:06:39 +02001/* -*- c++ -*- */
2/* @file
3 * @author Piotr Krysik <ptrkrysik@gmail.com>
4 * @section LICENSE
5 *
6 * Gr-gsm is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3, or (at your option)
9 * any later version.
10 *
11 * Gr-gsm is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with gr-gsm; see the file COPYING. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street,
19 * Boston, MA 02110-1301, USA.
20 *
21 */
22
23#ifdef HAVE_CONFIG_H
24#include "config.h"
25#endif
26
27#include <gnuradio/io_signature.h>
28//#include <gnuradio/msg_queue.h>
29#include "msg_to_tag_impl.h"
30
31namespace gr {
32 namespace grgsm {
33
34 msg_to_tag::sptr
35 msg_to_tag::make()
36 {
37 return gnuradio::get_initial_sptr
38 (new msg_to_tag_impl());
39 }
40
41// void msg_to_tag_impl::queue_msg(pmt::pmt_t msg){
42//
43// }
44
45 /*
46 * The private constructor
47 */
48 msg_to_tag_impl::msg_to_tag_impl()
49 : gr::sync_block("msg_to_tag",
50 gr::io_signature::make(1, 1, sizeof(gr_complex)),
51 gr::io_signature::make(1, 1, sizeof(gr_complex)))
52 {
53 message_port_register_in(pmt::mp("msg"));
54// set_msg_handler(pmt::mp("msg"), boost::bind(&msg_to_tag::queue_msg, this, _1));
55 }
56
57 /*
58 * Our virtual destructor.
59 */
60 msg_to_tag_impl::~msg_to_tag_impl()
61 {
62 }
63
64 int
65 msg_to_tag_impl::work(int noutput_items,
66 gr_vector_const_void_star &input_items,
67 gr_vector_void_star &output_items)
68 {
69 const gr_complex *in = (const gr_complex *) input_items[0];
70 gr_complex *out = (gr_complex *) output_items[0];
71
72 // Do <+signal processing+>
73 memcpy(out, in, sizeof(gr_complex)*noutput_items);
74 // Tell runtime system how many output items we produced.
75 return noutput_items;
76 }
77
78 } /* namespace grgsm */
79} /* namespace gr */
80