GNU Radio's SATELLITES Package
fixedlen_to_pdu.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2022,2025 Daniel Estevez <daniel@destevez.net>
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_SATELLITES_FIXEDLEN_TO_PDU_H
12#define INCLUDED_SATELLITES_FIXEDLEN_TO_PDU_H
13
14#include <gnuradio/pdu.h>
15#include <gnuradio/sync_block.h>
16#include <satellites/api.h>
17
18namespace gr {
19namespace satellites {
20
21/*!
22 * \brief Fixedlen to PDU
23 * \ingroup satellites
24 *
25 * Extracts PDUs of fixed maximum length according to syncword tags.
26 *
27 * Given an input stream containing tags that mark the location of frames, this
28 * block extracts PDUs starting at the location of those tags. The length of
29 * the PDUs is determined by either the presence of a packet length tag, if a
30 * key for this tag has been specified and such tag is present in the first
31 * item of the frame, or by the maximum packet length otherwise. The data in
32 * the PDUs may overlap if tags are spaced less than the PDU length.
33 */
34class SATELLITES_API fixedlen_to_pdu : virtual public gr::sync_block
35{
36public:
37 typedef std::shared_ptr<fixedlen_to_pdu> sptr;
38
39 /*!
40 * Make a Fixedlen to PDU block.
41 *
42 * \param type Input stream type.
43 * \param syncword_tag Name of the syncword tags to use.
44 * \param packet_len Maximum PDU length, in items of the input stream.
45 * \param pack When the input type is bytes and this option is enabled,
46 8 bits per byte are packed in the output PDU. The packet length should
47 correspond to the number of bits, and be a multiple of 8.
48 * \param packet_len_tag_key Key of the syncword tag to use for packet length.
49 If this key is empty, the max packet length is used for all the packets.
50 */
51 static sptr make(types::vector_type type,
52 const std::string& syncword_tag,
53 size_t packet_len,
54 bool pack = false,
55 const std::string& packet_len_tag_key = "");
56};
57
58} // namespace satellites
59} // namespace gr
60
61#endif /* INCLUDED_SATELLITES_FIXEDLEN_TO_PDU_H */
#define SATELLITES_API
Definition: api.h:31
Fixedlen to PDU.
Definition: fixedlen_to_pdu.h:35
static sptr make(types::vector_type type, const std::string &syncword_tag, size_t packet_len, bool pack=false, const std::string &packet_len_tag_key="")
std::shared_ptr< fixedlen_to_pdu > sptr
Definition: fixedlen_to_pdu.h:37
Definition: ax100_decode.h:17