aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Krysik <ptrkrysik@gmail.com>2016-05-29 13:06:39 +0200
committerPiotr Krysik <ptrkrysik@gmail.com>2016-05-29 13:06:39 +0200
commitc6eb3b5c6a013d5c19878a584b03c31813f87e77 (patch)
tree0f35d7738227b5842335c80216f123b109ca7bc4
parentaf8ad5dddf61ab57a514474627c1a2de0936a718 (diff)
Added msg_to_tag block - currently it does nothing
-rw-r--r--grc/CMakeLists.txt3
-rw-r--r--grc/grgsm_msg_to_tag.xml38
-rw-r--r--include/grgsm/CMakeLists.txt2
-rw-r--r--include/grgsm/msg_to_tag.h58
-rw-r--r--lib/CMakeLists.txt1
-rw-r--r--lib/msg_to_tag_impl.cc80
-rw-r--r--lib/msg_to_tag_impl.h50
-rw-r--r--python/CMakeLists.txt1
-rwxr-xr-xpython/qa_msg_to_tag.py43
-rw-r--r--swig/grgsm_swig.i3
10 files changed, 277 insertions, 2 deletions
diff --git a/grc/CMakeLists.txt b/grc/CMakeLists.txt
index 2b94539..47dfc89 100644
--- a/grc/CMakeLists.txt
+++ b/grc/CMakeLists.txt
@@ -24,5 +24,6 @@ add_subdirectory(receiver)
add_subdirectory(flow_control)
add_subdirectory(misc_utils)
install(FILES
- gsm_block_tree.xml DESTINATION share/gnuradio/grc/blocks
+ gsm_block_tree.xml
+ grgsm_msg_to_tag.xml DESTINATION share/gnuradio/grc/blocks
)
diff --git a/grc/grgsm_msg_to_tag.xml b/grc/grgsm_msg_to_tag.xml
new file mode 100644
index 0000000..fab2c6c
--- /dev/null
+++ b/grc/grgsm_msg_to_tag.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<block>
+ <name>msg_to_tag</name>
+ <key>grgsm_msg_to_tag</key>
+ <category>grgsm</category>
+ <import>import grgsm</import>
+ <make>grgsm.msg_to_tag()</make>
+ <!-- Make one 'param' node for every Parameter you want settable from the GUI.
+ Sub-nodes:
+ * name
+ * key (makes the value accessible as $keyname, e.g. in the make node)
+ * type -->
+ <param>
+ <name>...</name>
+ <key>...</key>
+ <type>...</type>
+ </param>
+
+ <!-- Make one 'sink' node per input. Sub-nodes:
+ * name (an identifier for the GUI)
+ * type
+ * vlen
+ * optional (set to 1 for optional inputs) -->
+ <sink>
+ <name>in</name>
+ <type><!-- e.g. int, float, complex, byte, short, xxx_vector, ...--></type>
+ </sink>
+
+ <!-- Make one 'source' node per output. Sub-nodes:
+ * name (an identifier for the GUI)
+ * type
+ * vlen
+ * optional (set to 1 for optional inputs) -->
+ <source>
+ <name>out</name>
+ <type><!-- e.g. int, float, complex, byte, short, xxx_vector, ...--></type>
+ </source>
+</block>
diff --git a/include/grgsm/CMakeLists.txt b/include/grgsm/CMakeLists.txt
index e9f6cc2..50788ae 100644
--- a/include/grgsm/CMakeLists.txt
+++ b/include/grgsm/CMakeLists.txt
@@ -24,7 +24,7 @@ install(FILES
plotting.hpp
api.h
gsmtap.h
- DESTINATION include/grgsm
+ msg_to_tag.h DESTINATION include/grgsm
)
add_subdirectory(decoding)
diff --git a/include/grgsm/msg_to_tag.h b/include/grgsm/msg_to_tag.h
new file mode 100644
index 0000000..3d63460
--- /dev/null
+++ b/include/grgsm/msg_to_tag.h
@@ -0,0 +1,58 @@
+/* -*- c++ -*- */
+/* @file
+ * @author Piotr Krysik <ptrkrysik@gmail.com>
+ * @section LICENSE
+ *
+ * Gr-gsm is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * Gr-gsm is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gr-gsm; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+
+#ifndef INCLUDED_GRGSM_MSG_TO_TAG_H
+#define INCLUDED_GRGSM_MSG_TO_TAG_H
+
+#include <grgsm/api.h>
+#include <gnuradio/sync_block.h>
+
+namespace gr {
+ namespace grgsm {
+
+ /*!
+ * \brief <+description of block+>
+ * \ingroup grgsm
+ *
+ */
+ class GRGSM_API msg_to_tag : virtual public gr::sync_block
+ {
+ public:
+ typedef boost::shared_ptr<msg_to_tag> sptr;
+
+ /*!
+ * \brief Return a shared_ptr to a new instance of grgsm::msg_to_tag.
+ *
+ * To avoid accidental use of raw pointers, grgsm::msg_to_tag's
+ * constructor is in a private implementation
+ * class. grgsm::msg_to_tag::make is the public interface for
+ * creating new instances.
+ */
+ static sptr make();
+ };
+
+ } // namespace grgsm
+} // namespace gr
+
+#endif /* INCLUDED_GRGSM_MSG_TO_TAG_H */
+
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 723ecce..3ce05f8 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -65,6 +65,7 @@ list(APPEND grgsm_sources
qa_utils/message_source_impl.cc
qa_utils/message_sink_impl.cc
decryption/decryption_impl.cc
+ msg_to_tag_impl.cc
)
diff --git a/lib/msg_to_tag_impl.cc b/lib/msg_to_tag_impl.cc
new file mode 100644
index 0000000..eb0fc13
--- /dev/null
+++ b/lib/msg_to_tag_impl.cc
@@ -0,0 +1,80 @@
+/* -*- c++ -*- */
+/* @file
+ * @author Piotr Krysik <ptrkrysik@gmail.com>
+ * @section LICENSE
+ *
+ * Gr-gsm is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * Gr-gsm is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gr-gsm; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gnuradio/io_signature.h>
+//#include <gnuradio/msg_queue.h>
+#include "msg_to_tag_impl.h"
+
+namespace gr {
+ namespace grgsm {
+
+ msg_to_tag::sptr
+ msg_to_tag::make()
+ {
+ return gnuradio::get_initial_sptr
+ (new msg_to_tag_impl());
+ }
+
+// void msg_to_tag_impl::queue_msg(pmt::pmt_t msg){
+//
+// }
+
+ /*
+ * The private constructor
+ */
+ msg_to_tag_impl::msg_to_tag_impl()
+ : gr::sync_block("msg_to_tag",
+ gr::io_signature::make(1, 1, sizeof(gr_complex)),
+ gr::io_signature::make(1, 1, sizeof(gr_complex)))
+ {
+ message_port_register_in(pmt::mp("msg"));
+// set_msg_handler(pmt::mp("msg"), boost::bind(&msg_to_tag::queue_msg, this, _1));
+ }
+
+ /*
+ * Our virtual destructor.
+ */
+ msg_to_tag_impl::~msg_to_tag_impl()
+ {
+ }
+
+ int
+ msg_to_tag_impl::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+ {
+ const gr_complex *in = (const gr_complex *) input_items[0];
+ gr_complex *out = (gr_complex *) output_items[0];
+
+ // Do <+signal processing+>
+ memcpy(out, in, sizeof(gr_complex)*noutput_items);
+ // Tell runtime system how many output items we produced.
+ return noutput_items;
+ }
+
+ } /* namespace grgsm */
+} /* namespace gr */
+
diff --git a/lib/msg_to_tag_impl.h b/lib/msg_to_tag_impl.h
new file mode 100644
index 0000000..e761d3e
--- /dev/null
+++ b/lib/msg_to_tag_impl.h
@@ -0,0 +1,50 @@
+/* -*- c++ -*- */
+/* @file
+ * @author Piotr Krysik <ptrkrysik@gmail.com>
+ * @section LICENSE
+ *
+ * Gr-gsm is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * Gr-gsm is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gr-gsm; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef INCLUDED_GRGSM_MSG_TO_TAG_IMPL_H
+#define INCLUDED_GRGSM_MSG_TO_TAG_IMPL_H
+
+#include <grgsm/msg_to_tag.h>
+
+namespace gr {
+ namespace grgsm {
+
+ class msg_to_tag_impl : public msg_to_tag
+ {
+ private:
+ // Nothing to declare in this block.
+
+ public:
+ msg_to_tag_impl();
+ ~msg_to_tag_impl();
+
+ // Where all the action really happens
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+ };
+
+ } // namespace grgsm
+} // namespace gr
+
+#endif /* INCLUDED_GRGSM_MSG_TO_TAG_IMPL_H */
+
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 8fc48de..aa77ff1 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -62,3 +62,4 @@ GR_ADD_TEST(qa_burst_sdcch_subslot_filter ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_S
GR_ADD_TEST(qa_burst_fnr_filter ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_burst_fnr_filter.py)
GR_ADD_TEST(qa_dummy_burst_filter ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_dummy_burst_filter.py)
GR_ADD_TEST(qa_arfcn ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_arfcn.py)
+GR_ADD_TEST(qa_msg_to_tag ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_msg_to_tag.py)
diff --git a/python/qa_msg_to_tag.py b/python/qa_msg_to_tag.py
new file mode 100755
index 0000000..eb206b1
--- /dev/null
+++ b/python/qa_msg_to_tag.py
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# @file
+# @author Piotr Krysik <ptrkrysik@gmail.com>
+# @section LICENSE
+#
+# Gr-gsm is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# Gr-gsm is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with gr-gsm; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+#
+
+from gnuradio import gr, gr_unittest
+from gnuradio import blocks
+import grgsm_swig as grgsm
+
+class qa_msg_to_tag (gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block ()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test_001_t (self):
+ # set up fg
+ self.tb.run ()
+ # check data
+
+
+if __name__ == '__main__':
+ gr_unittest.run(qa_msg_to_tag, "qa_msg_to_tag.xml")
diff --git a/swig/grgsm_swig.i b/swig/grgsm_swig.i
index dc2718e..81a5942 100644
--- a/swig/grgsm_swig.i
+++ b/swig/grgsm_swig.i
@@ -37,6 +37,7 @@
#include "grgsm/qa_utils/message_sink.h"
#include "grgsm/misc_utils/message_file_sink.h"
#include "grgsm/misc_utils/message_file_source.h"
+#include "grgsm/msg_to_tag.h"
%}
%include "grgsm/receiver/receiver.h"
@@ -103,3 +104,5 @@ GR_SWIG_BLOCK_MAGIC2(gsm, burst_source);
GR_SWIG_BLOCK_MAGIC2(gsm, message_source);
%include "grgsm/qa_utils/message_sink.h"
GR_SWIG_BLOCK_MAGIC2(gsm, message_sink);
+%include "grgsm/msg_to_tag.h"
+GR_SWIG_BLOCK_MAGIC2(grgsm, msg_to_tag);