forked from daniestevez/gr-satellites
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fixedlen_to_pdu_impl.h
55 lines (46 loc) · 1.38 KB
/
fixedlen_to_pdu_impl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* -*- c++ -*- */
/*
* Copyright 2022 Daniel Estevez <[email protected]>
*
* This file is part of gr-satellites
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#ifndef INCLUDED_SATELLITES_FIXEDLEN_TO_PDU_IMPL_H
#define INCLUDED_SATELLITES_FIXEDLEN_TO_PDU_IMPL_H
#include <satellites/fixedlen_to_pdu.h>
#include <list>
#include <vector>
namespace gr {
namespace satellites {
class fixedlen_to_pdu_impl : public fixedlen_to_pdu
{
private:
const types::vector_type d_type;
const bool d_pack;
const size_t d_packetlen;
const size_t d_packet_nbytes;
const size_t d_pdu_items;
const pmt::pmt_t d_syncword_tag;
std::vector<uint8_t> d_history;
size_t d_write_ptr_item;
size_t d_write_ptr_byte;
std::vector<uint8_t> d_packet;
std::vector<tag_t> d_tags_in_window;
std::list<uint64_t> d_tag_offsets;
void pack_packet();
void update_history(const uint8_t* in, int noutput_items);
public:
fixedlen_to_pdu_impl(types::vector_type type,
const std::string& syncword_tag,
size_t packet_len,
bool pack);
~fixedlen_to_pdu_impl();
int work(int noutput_items,
gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items);
};
} // namespace satellites
} // namespace gr
#endif /* INCLUDED_SATELLITES_FIXEDLEN_TO_PDU_IMPL_H */