GNU Radio's CYBERRADIO Package
vita_udp_rx_impl.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2022 G3.
4 *
5 * SPDX-License-Identifier: GPL-3.0-or-later
6 */
7
8#ifndef INCLUDED_CYBERRADIO_VITA_UDP_RX_IMPL_H
9#define INCLUDED_CYBERRADIO_VITA_UDP_RX_IMPL_H
10
12
13typedef struct {
14 uint32_t packet_info;
15 uint32_t stream_id;
16 uint32_t class_0;
17 uint32_t class_1;
18 uint32_t int_timestamp;
21 uint32_t ddc_0;
22 uint32_t ddc_1;
23 uint32_t ddc_2;
24 uint32_t ddc_3;
25 uint32_t ddc_4;
27
28namespace gr {
29 namespace CyberRadio {
30
32 {
33 using Base = vita_udp_rx;
34 private:
35 // Variables
36 std::string const d_src_ip;
37 unsigned short const d_port;
38 int d_sock;
39
40 int const d_samples_per_packet;
41 size_t const d_header_byte_offset;
42 size_t const d_bytes_per_packet;
43 bool const d_swap_bytes;
44 bool const d_swap_iq;
45 bool const d_uses_v49_1;
46 bool const d_is_narrowband;
47 bool const d_tag_packets;
48 bool d_debug;
49 bool d_first_packet;
50 unsigned d_packetCounter : 4;
51 bool d_use_vector_output;
52 uint64_t d_frac_last_timestamp;
53
54 std::vector<uint8_t> d_buffer;
55 protected:
56 // Methods
57 auto receive_packet() -> bool;
58 auto process_packet(gr_complex*& outP, int samples_needed) -> int;
59 auto process_v491_packet(gr_complex*& outP) -> int;
60 auto handle_dropped_packet(unsigned packet_counter,
61 gr_complex*& outP,
62 int samples_needed) -> int;
63 auto process_IQ(gr_complex*& outP) -> int;
64
65
66 auto tag_packet(int stream, int offset) -> void;
67 auto tag_v491_packet(int stream, int offset) -> void;
68 public:
70
71 vita_udp_rx_impl(std::string src_ip,
72 unsigned short port,
73 unsigned int header_byte_offset,
74 int samples_per_packet,
75 int bytes_per_packet,
76 bool swap_bytes,
77 bool swap_iq,
78 bool tag_packets,
79 bool vector_output,
80 bool uses_v491,
81 bool narrowband,
82 bool debug);
83
84 void rxControlMsg(pmt::pmt_t msg);
86
87 bool start() override;
88 bool stop() override;
89
90 // Where all the action really happens
91 int general_work(int noutput_items,
92 gr_vector_int& ninput_items,
93 gr_vector_const_void_star& input_items,
94 gr_vector_void_star& output_items) override;
95 };
96
97 } // namespace CyberRadio
98} // namespace gr
99
100#endif /* INCLUDED_CYBERRADIO_VITA_UDP_RX_IMPL_H */
auto process_IQ(gr_complex *&outP) -> int
auto process_v491_packet(gr_complex *&outP) -> int
auto tag_v491_packet(int stream, int offset) -> void
auto tag_packet(int stream, int offset) -> void
auto process_packet(gr_complex *&outP, int samples_needed) -> int
auto handle_dropped_packet(unsigned packet_counter, gr_complex *&outP, int samples_needed) -> int
void rxControlMsg(pmt::pmt_t msg)
vita_udp_rx_impl(std::string src_ip, unsigned short port, unsigned int header_byte_offset, int samples_per_packet, int bytes_per_packet, bool swap_bytes, bool swap_iq, bool tag_packets, bool vector_output, bool uses_v491, bool narrowband, bool debug)
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) override
<+description of block+>
Definition vita_udp_rx.h:23
Provides programming elements for controlling CyberRadio Solutions products.
Definition single_pole_iir.h:30
Definition vita_udp_rx_impl.h:13
uint32_t ddc_1
Definition vita_udp_rx_impl.h:22
uint32_t class_1
Definition vita_udp_rx_impl.h:17
uint32_t ddc_4
Definition vita_udp_rx_impl.h:25
uint32_t packet_info
Definition vita_udp_rx_impl.h:14
uint32_t int_timestamp
Definition vita_udp_rx_impl.h:18
uint32_t ddc_2
Definition vita_udp_rx_impl.h:23
uint32_t stream_id
Definition vita_udp_rx_impl.h:15
uint32_t ddc_3
Definition vita_udp_rx_impl.h:24
uint32_t ddc_0
Definition vita_udp_rx_impl.h:21
uint32_t class_0
Definition vita_udp_rx_impl.h:16
uint32_t frac_timestamp_msw
Definition vita_udp_rx_impl.h:19
uint32_t frac_timestamp_lsw
Definition vita_udp_rx_impl.h:20