summaryrefslogtreecommitdiff
path: root/gr-blocks/include
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2013-02-28 11:02:21 -0800
committerJohnathan Corgan <johnathan@corganlabs.com>2013-02-28 11:02:21 -0800
commit33c7198b12eaae233e5e0e0a2bc266f2efb018b1 (patch)
tree184eff568243b976bb41501175d090d88213b0a3 /gr-blocks/include
parent51c02f87a08efa4e679630771ec7dd0605e4986a (diff)
blocks: added gr::blocks::pdu namespace for PDU functions
Diffstat (limited to 'gr-blocks/include')
-rw-r--r--gr-blocks/include/blocks/CMakeLists.txt1
-rw-r--r--gr-blocks/include/blocks/pdu.h48
2 files changed, 49 insertions, 0 deletions
diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt
index cea725d360..05672ecf90 100644
--- a/gr-blocks/include/blocks/CMakeLists.txt
+++ b/gr-blocks/include/blocks/CMakeLists.txt
@@ -127,6 +127,7 @@ install(FILES
nlog10_ff.h
pack_k_bits_bb.h
patterned_interleaver.h
+ pdu.h
peak_detector2_fb.h
regenerate_bb.h
repeat.h
diff --git a/gr-blocks/include/blocks/pdu.h b/gr-blocks/include/blocks/pdu.h
new file mode 100644
index 0000000000..de0999c574
--- /dev/null
+++ b/gr-blocks/include/blocks/pdu.h
@@ -0,0 +1,48 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2013 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio 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.
+ *
+ * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_BLOCKS_PDU_H
+#define INCLUDED_BLOCKS_PDU_H
+
+#include <blocks/api.h>
+#include <gr_complex.h>
+#include <gruel/pmt.h>
+
+#define PDU_PORT_ID pmt::mp("pdus")
+#define PDU_LENGTH_TAG pmt::mp("pdu_length")
+
+namespace gr {
+ namespace blocks {
+ namespace pdu {
+
+ enum vector_type { byte_t, float_t, complex_t };
+
+ BLOCKS_API size_t itemsize(vector_type type);
+ BLOCKS_API bool type_matches(vector_type type, pmt::pmt_t v);
+ BLOCKS_API pmt::pmt_t make_vector(vector_type type, const uint8_t* buf, size_t items);
+ BLOCKS_API vector_type type_from_pmt(pmt::pmt_t vector);
+
+ } /* namespace pdu */
+ } /* namespace blocks */
+} /* namespace gr */
+
+#endif /* INCLUDED_BLOCKS_PDU_H */