GNU Radio's SATELLITES Package
varlen_packet_framer_impl.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_FRAMER_IMPL_H
20 #define INCLUDED_VARLEN_PACKET_FRAMER_IMPL_H
21 
23 #include <pmt/pmt.h>
24 
25 //#define VLPF_DEBUG_TIMING
26 
27 namespace gr {
28  namespace satellites {
31  {
32  private:
33  int d_header_length; // size of packet length field in bits
34  bool d_use_golay; // decode golay packet length
35  std::vector<uint8_t> d_sync_word; // option ASM
36  endianness_t d_endianness; // header endianness
37  pmt::pmt_t d_packet_tag; // packet length tag
38  int d_ninput_items_required;
39 
40 #ifdef VLPF_DEBUG_TIMING
41  std::time_t d_last_debug1;
42  std::time_t d_last_debug2;
43  std::time_t d_start_time;
44 #endif
45 
46 
47  public:
48  varlen_packet_framer_impl(const std::string &packet_key,
49  int length_field_size,
50  endianness_t endianness,
51  bool use_golay,
52  const std::vector<uint8_t> sync_word);
53 
55 
56  void forecast(int noutput_items, gr_vector_int &ninput_items_required);
57 
58  int general_work(int noutput_items,
59  gr_vector_int &ninput_items,
60  gr_vector_const_void_star &input_items,
61  gr_vector_void_star &output_items);
62  };
63 
64  } // namespace satellites
65 } // namespace gr
66 
67 #endif
68 
Definition: varlen_packet_framer_impl.h:31
varlen_packet_framer_impl(const std::string &packet_key, int length_field_size, endianness_t endianness, bool use_golay, const std::vector< uint8_t > sync_word)
void forecast(int noutput_items, gr_vector_int &ninput_items_required)
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
insert a packet length field into a tagged stream
Definition: varlen_packet_framer.h:41
Definition: ao40_deinterleaver.h:25