GNU Radio's SATELLITES Package
varlen_packet_tagger.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2017 Glenn Richardson <glenn@spacequest.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3, or (at your option)
8 * any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>
17 */
18
19#ifndef INCLUDED_VARLEN_PACKET_TAGGER_H
20#define INCLUDED_VARLEN_PACKET_TAGGER_H
21
22#include <satellites/api.h>
23#include <gnuradio/block.h>
24#include <gnuradio/endianness.h>
25#include <pmt/pmt.h>
26
27namespace gr {
28 namespace satellites {
29 /*!
30 * \brief Examine input stream for sync tags and extract packet length.
31 * \ingroup satellites
32 *
33 * \details
34 * input: stream of bits (unpacked bytes) with sync tags
35 * output: a tagged stream of bits containing just the received packets
36 *
37 * This block uses the sync tag on the input stream to identify
38 * the header of packets. The length of each packet is extracted
39 * from the stream's header. The length of the header field and
40 * the endianness are parameters.
41 *
42 */
43 class SATELLITES_API varlen_packet_tagger : virtual public gr::block
44 {
45 public:
46 typedef boost::shared_ptr<varlen_packet_tagger> sptr;
47
48 /*!
49 * \param sync_key
50 * \param packet_key
51 * \param length_field_size
52 * \param max_packet_size
53 * \param endianness
54 * \param use_golay For 24-bit golay headers
55 */
56 static sptr make(const std::string &sync_key,
57 const std::string &packet_key,
58 int length_field_size,
59 int max_packet_size,
60 endianness_t endianness,
61 bool use_golay);
62 };
63
64 } // namespace satellites
65} // namespace gr
66
67#endif
68
#define SATELLITES_API
Definition api.h:30
Examine input stream for sync tags and extract packet length.
Definition varlen_packet_tagger.h:44
boost::shared_ptr< varlen_packet_tagger > sptr
Definition varlen_packet_tagger.h:46
static sptr make(const std::string &sync_key, const std::string &packet_key, int length_field_size, int max_packet_size, endianness_t endianness, bool use_golay)
Definition ao40_deinterleaver.h:25