GNU Radio 3.7.1 C++ API
framer_sink_1.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2005,2006,2012 Free Software Foundation, Inc.
00004  *
00005  * This file is part of GNU Radio
00006  *
00007  * GNU Radio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 3, or (at your option)
00010  * any later version.
00011  *
00012  * GNU Radio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with GNU Radio; see the file COPYING.  If not, write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street,
00020  * Boston, MA 02110-1301, USA.
00021  */
00022 
00023 #ifndef INCLUDED_GR_FRAMER_SINK_1_H
00024 #define INCLUDED_GR_FRAMER_SINK_1_H
00025 
00026 #include <gnuradio/digital/api.h>
00027 #include <gnuradio/sync_block.h>
00028 #include <gnuradio/msg_queue.h>
00029 
00030 namespace gr {
00031   namespace digital {
00032 
00033     /*!
00034      * \brief Given a stream of bits and access_code flags, assemble packets.
00035      * \ingroup packet_operators_blk
00036      *
00037      * \details
00038      * input: stream of bytes from digital_correlate_access_code_bb
00039      * output: none. Pushes assembled packet into target queue
00040      *
00041      * The framer expects a fixed length header of 2 16-bit shorts
00042      * containing the payload length, followed by the payload. If the
00043      * 2 16-bit shorts are not identical, this packet is
00044      * ignored. Better algs are welcome.
00045      *
00046      * The input data consists of bytes that have two bits used. Bit
00047      * 0, the LSB, contains the data bit. Bit 1 if set, indicates that
00048      * the corresponding bit is the the first bit of the packet. That
00049      * is, this bit is the first one after the access code.
00050      */
00051     class DIGITAL_API framer_sink_1 : virtual public sync_block
00052     {
00053     public:
00054       // gr::digital::framer_sink_1::sptr
00055       typedef boost::shared_ptr<framer_sink_1> sptr;
00056 
00057       /*!
00058        * Make a framer_sink_1 block.
00059        *
00060        * \param target_queue The message queue where frames go.
00061        */
00062       static sptr make(msg_queue::sptr target_queue);
00063     };
00064 
00065   } /* namespace digital */
00066 } /* namespace gr */
00067 
00068 #endif /* INCLUDED_GR_FRAMER_SINK_1_H */