GNU Radio's IRIDIUM Package
tagged_burst_to_pdu_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2020 Free Software Foundation, Inc.
4  *
5  * This is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3, or (at your option)
8  * any later version.
9  *
10  * This software is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this software; see the file COPYING. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef INCLUDED_IRIDIUM_TAGGED_BURST_TO_PDU_IMPL_H
22 #define INCLUDED_IRIDIUM_TAGGED_BURST_TO_PDU_IMPL_H
23 
25 
26 namespace gr {
27  namespace iridium {
28 
29  struct burst_data {
30  uint64_t id;
31  double offset;
32  float magnitude;
35  float sample_rate;
36  uint64_t timestamp;
37  float noise;
38  size_t len;
39  gr_complex * data;
40  };
41 
43  {
44  private:
45  bool d_debug;
46  float d_relative_center_frequency;
47  float d_relative_span;
48  float d_relative_sample_rate;
49  double d_sample_offset;
50  int d_max_burst_size;
51  int d_outstanding;
52  int d_max_outstanding;
53  int d_outstanding_limit;
54  uint64_t d_n_dropped_bursts;
55  bool d_drop_overflow;
56  bool d_blocked;
57 
58  float d_lower_border;
59  float d_upper_border;
60 
61  std::map<uint64_t, burst_data> d_bursts;
62 
63  void append_to_burst(burst_data &burst, const gr_complex * data, size_t n);
64  void publish_burst(burst_data &burst);
65 
66  void create_new_bursts(int noutput_items,
67  const gr_complex * in);
68  void publish_and_remove_old_bursts(int noutput_items, const gr_complex * in);
69  void update_current_bursts(int noutput_items, const gr_complex * in);
70 
71  int get_output_queue_size();
72  int get_output_max_queue_size();
73  void burst_handled(pmt::pmt_t msg);
74  public:
75  tagged_burst_to_pdu_impl(int max_burst_size, float relative_center_frequency,
76  float relative_span, float d_relative_sample_rate,
77  double sample_offset,
78  int outstanding_limit, bool drop_overflow);
80 
81  uint64_t get_n_dropped_bursts();
82 
83  // Where all the action really happens
84  int work(int noutput_items,
85  gr_vector_const_void_star &input_items,
86  gr_vector_void_star &output_items);
87  };
88 
89  } // namespace iridium
90 } // namespace gr
91 
92 #endif /* INCLUDED_IRIDIUM_TAGGED_BURST_TO_PDU_IMPL_H */
93 
double offset
Definition: tagged_burst_to_pdu_impl.h:31
Definition: fft_burst_tagger_impl.h:30
float magnitude
Definition: tagged_burst_to_pdu_impl.h:32
tagged_burst_to_pdu_impl(int max_burst_size, float relative_center_frequency, float relative_span, float d_relative_sample_rate, double sample_offset, int outstanding_limit, bool drop_overflow)
uint64_t id
Definition: tagged_burst_to_pdu_impl.h:30
size_t len
Definition: tagged_burst_to_pdu_impl.h:38
gr_complex * data
Definition: tagged_burst_to_pdu_impl.h:39
float sample_rate
Definition: tagged_burst_to_pdu_impl.h:35
Definition: burst_downmix.h:27
float noise
Definition: tagged_burst_to_pdu_impl.h:37
Definition: tagged_burst_to_pdu_impl.h:29
Definition: iridium.h:2
double center_frequency
Definition: tagged_burst_to_pdu_impl.h:34
uint64_t timestamp
Definition: tagged_burst_to_pdu_impl.h:36
Definition: tagged_burst_to_pdu_impl.h:42
float relative_frequency
Definition: tagged_burst_to_pdu_impl.h:33
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
<+description of block+>
Definition: tagged_burst_to_pdu.h:35