GNU Radio's GR-AIR-MODES Package
air_modes_preamble.h
Go to the documentation of this file.
1 /*
2 # Copyright 2010 Nick Foster
3 #
4 # This file is part of gr-air-modes
5 #
6 # gr-air-modes is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3, or (at your option)
9 # any later version.
10 #
11 # gr-air-modes is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with gr-air-modes; see the file COPYING. If not, write to
18 # the Free Software Foundation, Inc., 51 Franklin Street,
19 # Boston, MA 02110-1301, USA.
20 #
21 */
22 
23 #ifndef INCLUDED_AIR_MODES_PREAMBLE_H
24 #define INCLUDED_AIR_MODES_PREAMBLE_H
25 
26 #include <gnuradio/block.h>
27 #include <air_modes_api.h>
28 
29 class air_modes_preamble;
30 typedef boost::shared_ptr<air_modes_preamble> air_modes_preamble_sptr;
31 
32 AIR_MODES_API air_modes_preamble_sptr air_make_modes_preamble(int channel_rate, float threshold_db);
33 
34 /*!
35  * \brief mode select preamble detection
36  * \ingroup block
37  */
38 class AIR_MODES_API air_modes_preamble : public gr::block
39 {
40 private:
41  friend air_modes_preamble_sptr air_make_modes_preamble(int channel_rate, float threshold_db);
42  air_modes_preamble(int channel_rate, float threshold_db);
43 
44  int d_check_width;
45  int d_chip_rate;
46  float d_preamble_length_us;
47  int d_samples_per_chip;
48  int d_samples_per_symbol;
49  float d_threshold_db;
50  float d_threshold;
51  pmt::pmt_t d_me, d_key;
52  gr::tag_t d_timestamp;
53  double d_secs_per_sample;
54 
55 public:
56  int general_work (int noutput_items,
57  gr_vector_int &ninput_items,
58  gr_vector_const_void_star &input_items,
59  gr_vector_void_star &output_items);
60 
61  void set_rate(int channel_rate);
62  void set_threshold(float threshold_db);
63  float get_threshold(void);
64 };
65 
66 #endif /* INCLUDED_AIR_MODES_PREAMBLE_H */
#define AIR_MODES_API
Definition: air_modes_api.h:30
mode select preamble detection
Definition: air_modes_preamble.h:38
AIR_MODES_API air_modes_preamble_sptr air_make_modes_preamble(int channel_rate, float threshold_db)