diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2013-03-15 09:57:31 -0700 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2013-03-15 09:57:31 -0700 |
commit | e965a5bb209ad46a509ccd21f393667fd69d95f9 (patch) | |
tree | 40d683ef8f80980f12eac6cfe7f3423c49b45f87 /gr-digital/include/digital/header_payload_demux.h | |
parent | 2bf9c4cb4b0b426690f353fc1662a13e70c0d5e0 (diff) | |
parent | 27990ca9e236931e39a830e48f0a1efe13ec085f (diff) |
Merge branch 'ofdm-master' into ofdm-next
Added fixups for next branch changes
Conflicts:
CMakeLists.txt
gnuradio-core/src/lib/io/gr_message_sink.cc
gnuradio-core/src/lib/io/gr_message_sink.h
gnuradio-core/src/lib/io/gr_message_sink.i
gnuradio-core/src/lib/io/gr_message_source.cc
gnuradio-core/src/lib/io/gr_message_source.h
gnuradio-core/src/lib/io/gr_message_source.i
gr-blocks/CMakeLists.txt
gr-digital/CMakeLists.txt
gr-digital/grc/digital_block_tree.xml
gr-digital/include/digital/CMakeLists.txt
gr-digital/include/digital_ofdm_cyclic_prefixer.h
gr-digital/lib/CMakeLists.txt
gr-digital/lib/digital_ofdm_cyclic_prefixer.cc
gr-digital/lib/ofdm_cyclic_prefixer_impl.h
gr-digital/python/CMakeLists.txt
gr-digital/swig/CMakeLists.txt
gr-digital/swig/digital_swig.i
Diffstat (limited to 'gr-digital/include/digital/header_payload_demux.h')
-rw-r--r-- | gr-digital/include/digital/header_payload_demux.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/gr-digital/include/digital/header_payload_demux.h b/gr-digital/include/digital/header_payload_demux.h new file mode 100644 index 0000000000..014e0304a2 --- /dev/null +++ b/gr-digital/include/digital/header_payload_demux.h @@ -0,0 +1,90 @@ +/* -*- c++ -*- */ +/* Copyright 2012 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_DIGITAL_HEADER_PAYLOAD_DEMUX_H +#define INCLUDED_DIGITAL_HEADER_PAYLOAD_DEMUX_H + +#include <digital/api.h> +#include <gr_block.h> + +namespace gr { + namespace digital { + + /*! + * \brief Header/Payload demuxer. + * \ingroup digital + * + * This block is designed to handle packets from a bursty transmission. + * Input 0 takes a continuous transmission of samples. + * If used, input 1 is a trigger signal. In this case, a 1 on input 1 + * is a trigger. Otherwise, a tag with the key specified in \p trigger_tag_key + * is used as a trigger (its value is irrelevant). + * + * Until a trigger signal is detected, all samples are dropped onto the floor. + * Once a trigger is detected, a total of \p header_len items are copied to output 0. + * The block then stalls until it receives a message on the message port + * \p header_data. The message must be a PMT dictionary; all key/value pairs are + * copied as tags to the first item of the payload (which is assumed to be the + * first item after the header). + * The value corresponding to the key specified in \p length_tag_key is read + * and taken as the payload length. The payload, together with the header data + * as tags, is then copied to output 1. + * + * If specified, \p guard_interval items are discarded before every symbol. + * This is useful for demuxing bursts of OFDM signals. + * + * Any tags on the input stream are copied to the corresponding output *if* they're + * on an item that is propagated. Note that a tag on the header items is copied to the + * header stream; that means the header-parsing block must handle these tags if they + * should go on the payload. + * A special case are tags on items that make up the guard interval. These are copied + * to the first item of the following symbol. + */ + class DIGITAL_API header_payload_demux : virtual public gr_block + { + public: + typedef boost::shared_ptr<header_payload_demux> sptr; + + /*! + * \param header_len Number of symbols per header + * \param items_per_symbol Number of items per symbol + * \param guard_interval Number of items between two consecutive symbols + * \param length_tag_key Key of the frame length tag + * \param trigger_tag_key Key of the trigger tag + * \param output_symbols Output symbols (true) or items (false)? + * \param itemsize Item size (bytes per item) + */ + static sptr make( + int header_len, + int items_per_symbol, + int guard_interval=0, + const std::string &length_tag_key="frame_len", + const std::string &trigger_tag_key="", + bool output_symbols=false, + size_t itemsize=sizeof(gr_complex) + ); + }; + + } // namespace digital +} // namespace gr + +#endif /* INCLUDED_DIGITAL_HEADER_PAYLOAD_DEMUX_H */ + |