GNU Radio's SATELLITES Package

fixedlen_to_pdu_impl.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2022 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
14#include <gnuradio/blocks/pdu.h>
15#include <satellites/fixedlen_to_pdu.h>
16#include <vector>
17
18 namespace gr {
19 namespace satellites {
20
21 class fixedlen_to_pdu_impl : public fixedlen_to_pdu
22{
23 private:
24 const blocks::pdu::vector_type d_type;
25 const bool d_pack;
26 const size_t d_packetlen;
27 const size_t d_packet_nbytes;
28 const size_t d_pdu_items;
29 const pmt::pmt_t d_syncword_tag;
30 std::vector<uint8_t> d_history;
31 size_t d_write_ptr_item;
32 size_t d_write_ptr_byte;
33 std::vector<uint8_t> d_packet;
34 std::vector<tag_t> d_tags_in_window;
35 std::list<uint64_t> d_tag_offsets;
36
37 void pack_packet();
38 void update_history(const uint8_t* in, int noutput_items);
39
40 public:
41 fixedlen_to_pdu_impl(blocks::pdu::vector_type type,
42 const std::string& syncword_tag,
43 size_t packet_len,
44 bool pack);
45 ~fixedlen_to_pdu_impl();
46
47 int work(int noutput_items,
48 gr_vector_const_void_star& input_items,
49 gr_vector_void_star& output_items);
50};
51
52} // namespace satellites
53} // namespace gr
54
55#endif /* INCLUDED_SATELLITES_FIXEDLEN_TO_PDU_IMPL_H */
gr::satellites::fixedlen_to_pdu_impl::fixedlen_to_pdu_impl
fixedlen_to_pdu_impl(blocks::pdu::vector_type type, const std::string &syncword_tag, size_t packet_len, bool pack)
gr::satellites::fixedlen_to_pdu_impl::~fixedlen_to_pdu_impl
~fixedlen_to_pdu_impl()
gr::satellites::fixedlen_to_pdu_impl::work
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
gr::satellites::fixedlen_to_pdu
Fixedlen to PDU.
Definition fixedlen_to_pdu.h:27
fixedlen_to_pdu.h
gr::satellites
Definition ax100_decode.h:18
gr
Definition ax100_decode.h:17