GNU Radio's SATELLITES Package
varlen_packet_tagger_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_TAGGER_IMPL_H
20 #define INCLUDED_VARLEN_PACKET_TAGGER_IMPL_H
21 
23 #include <pmt/pmt.h>
24 
25 
26 namespace gr {
27  namespace satellites {
30  {
31  private:
32  int d_header_length; // bit size of packet length field
33  int d_mtu; // maximum packet size in bits
34  bool d_use_golay; // decode golay packet length
35  endianness_t d_endianness; // header endianness
36 
37  pmt::pmt_t d_sync_tag; // marker tag on input for start of packet
38  pmt::pmt_t d_packet_tag; // packet_len tag for output stream
39 
40  bool d_have_sync; // interal state
41  int d_ninput_items_required; // forecast
42 
43  int bits2len(const unsigned char *in);
44 
45  public:
46  varlen_packet_tagger_impl(const std::string &sync_key,
47  const std::string &packet_key,
48  int length_field_size,
49  int max_packet_size,
50  endianness_t endianness,
51  bool use_golay);
53 
54  void forecast(int noutput_items, gr_vector_int &ninput_itens_required);
55 
56  int general_work(int noutput_items,
57  gr_vector_int &ninput_items,
58  gr_vector_const_void_star &input_items,
59  gr_vector_void_star &output_items);
60  };
61 
62  } // namespace satellites
63 } // namespace gr
64 
65 #endif
66 
Definition: varlen_packet_tagger_impl.h:30
void forecast(int noutput_items, gr_vector_int &ninput_itens_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)
varlen_packet_tagger_impl(const std::string &sync_key, const std::string &packet_key, int length_field_size, int max_packet_size, endianness_t endianness, bool use_golay)
Examine input stream for sync tags and extract packet length.
Definition: varlen_packet_tagger.h:44
Definition: ao40_deinterleaver.h:25