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 file is part of gr-satellites
6 *
7 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef INCLUDED_VARLEN_PACKET_TAGGER_IMPL_H
12#define INCLUDED_VARLEN_PACKET_TAGGER_IMPL_H
13
14#include <pmt/pmt.h>
15#include <satellites/varlen_packet_tagger.h>
16
17
18 namespace gr {
19 namespace satellites {
20 class varlen_packet_tagger_impl : public varlen_packet_tagger
21{
22 private:
23 int d_header_length; // bit size of packet length field
24 int d_mtu; // maximum packet size in bits
25 bool d_use_golay; // decode golay packet length
26 endianness_t d_endianness; // header endianness
27
28 pmt::pmt_t d_sync_tag; // marker tag on input for start of packet
29 pmt::pmt_t d_packet_tag; // packet_len tag for output stream
30
31 bool d_have_sync; // interal state
32 int d_ninput_items_required; // forecast
33
34 int bits2len(const unsigned char* in);
35
36 public:
37 varlen_packet_tagger_impl(const std::string& sync_key,
38 const std::string& packet_key,
39 int length_field_size,
40 int max_packet_size,
41 endianness_t endianness,
42 bool use_golay);
43 ~varlen_packet_tagger_impl();
44
45 void forecast(int noutput_items, gr_vector_int& ninput_itens_required);
46
47 int general_work(int noutput_items,
48 gr_vector_int& ninput_items,
49 gr_vector_const_void_star& input_items,
50 gr_vector_void_star& output_items);
51};
52
53} // namespace satellites
54} // namespace gr
55
56#endif
gr::satellites::varlen_packet_tagger_impl::~varlen_packet_tagger_impl
~varlen_packet_tagger_impl()
gr::satellites::varlen_packet_tagger_impl::forecast
void forecast(int noutput_items, gr_vector_int &ninput_itens_required)
gr::satellites::varlen_packet_tagger_impl::general_work
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
gr::satellites::varlen_packet_tagger_impl::varlen_packet_tagger_impl
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)
gr::satellites::varlen_packet_tagger
Examine input stream for sync tags and extract packet length.
Definition varlen_packet_tagger.h:36
gr::satellites
Definition ax100_decode.h:18
gr
Definition ax100_decode.h:17
varlen_packet_tagger.h