GNU Radio's SATELLITES Package
fixedlen_to_pdu_impl.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_IMPL_H
12#define INCLUDED_SATELLITES_FIXEDLEN_TO_PDU_IMPL_H
13
15#include <optional>
16#include <vector>
17
18namespace gr {
19namespace satellites {
20
22 uint64_t offset;
23 int length;
24};
25
27{
28private:
29 const types::vector_type d_type;
30 const size_t d_itemsize;
31 const bool d_pack;
32 const size_t d_packetlen;
33 const pmt::pmt_t d_syncword_tag;
34 const std::optional<pmt::pmt_t> d_packet_length_tag;
35 std::vector<uint8_t> d_history;
36 size_t d_write_ptr_item{ 0 };
37 size_t d_write_ptr_byte{ 0 };
38 std::vector<uint8_t> d_packet;
39 std::vector<packet_info> d_packet_infos;
40 std::vector<packet_info> d_new_packet_infos;
41
42 void pack_packet(size_t size_bytes);
43 void update_history(const uint8_t* in, int noutput_items);
44
45public:
46 fixedlen_to_pdu_impl(types::vector_type type,
47 const std::string& syncword_tag,
48 size_t packet_len,
49 bool pack,
50 const std::string& packet_len_tag_key);
52
53 int work(int noutput_items,
54 gr_vector_const_void_star& input_items,
55 gr_vector_void_star& output_items) override;
56};
57
58} // namespace satellites
59} // namespace gr
60
61#endif /* INCLUDED_SATELLITES_FIXEDLEN_TO_PDU_IMPL_H */
Definition: fixedlen_to_pdu_impl.h:27
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) override
fixedlen_to_pdu_impl(types::vector_type type, const std::string &syncword_tag, size_t packet_len, bool pack, const std::string &packet_len_tag_key)
Fixedlen to PDU.
Definition: fixedlen_to_pdu.h:35
Definition: ax100_decode.h:17
Definition: fixedlen_to_pdu_impl.h:21
int length
Definition: fixedlen_to_pdu_impl.h:23
uint64_t offset
Definition: fixedlen_to_pdu_impl.h:22