summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/include/gnuradio/pdu.h
blob: d94dde8bb86fceec62d12a44bdc4304f86e6c098 (plain)
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
56
57
58
/* -*- c++ -*- */
/*
 * Copyright 2013,2021 Free Software Foundation, Inc.
 *
 * This file is part of GNU Radio
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 *
 */


#ifndef INCLUDED_GR_PDU_H
#define INCLUDED_GR_PDU_H

#include <gnuradio/api.h>
#include <pmt/pmt.h>

namespace gr {
namespace metadata_keys {
GR_RUNTIME_API const pmt::pmt_t pdu_num();
GR_RUNTIME_API const pmt::pmt_t rx_time();
GR_RUNTIME_API const pmt::pmt_t sample_rate();
GR_RUNTIME_API const pmt::pmt_t sys_time();
GR_RUNTIME_API const pmt::pmt_t tx_eob();
GR_RUNTIME_API const pmt::pmt_t tx_time();
GR_RUNTIME_API const pmt::pmt_t tx_sob();
} /* namespace metadata_keys */

namespace msgport_names {
// static const PMT interned string getters for standard port names
GR_RUNTIME_API const pmt::pmt_t bpdu();
GR_RUNTIME_API const pmt::pmt_t conf();
GR_RUNTIME_API const pmt::pmt_t cpdu();
GR_RUNTIME_API const pmt::pmt_t detects();
GR_RUNTIME_API const pmt::pmt_t dict();
GR_RUNTIME_API const pmt::pmt_t fpdu();
GR_RUNTIME_API const pmt::pmt_t msg();
GR_RUNTIME_API const pmt::pmt_t pdu();
GR_RUNTIME_API const pmt::pmt_t pdus();
GR_RUNTIME_API const pmt::pmt_t vec();
} /* namespace msgport_names */

namespace types {
enum vector_type { byte_t, short_t, int_t, float_t, complex_t };
} /* namespace types */

namespace pdu {
// pdu functions
GR_RUNTIME_API size_t itemsize(types::vector_type type);
GR_RUNTIME_API bool type_matches(types::vector_type type, pmt::pmt_t v);
GR_RUNTIME_API pmt::pmt_t
make_pdu_vector(types::vector_type type, const uint8_t* buf, size_t items);
GR_RUNTIME_API types::vector_type type_from_pmt(pmt::pmt_t vector);

} // namespace pdu
} // namespace gr

#endif /* INCLUDED_GR_PDU_H */