GNU Radio's LORA Package
mod_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2016 Bastille Networks.
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_LORA_MOD_IMPL_H
22 #define INCLUDED_LORA_MOD_IMPL_H
23 
24 #include <vector>
25 #include <complex>
26 #include <fstream>
27 #include <volk/volk.h>
28 #include <lora/mod.h>
29 
30 #define NUM_PREAMBLE_CHIRPS 8
31 #define LORA_SYNCWORD0 3
32 #define LORA_SYNCWORD1 4
33 
34 namespace gr {
35  namespace lora {
36 
37  class mod_impl : public mod
38  {
39  private:
40  pmt::pmt_t d_in_port;
41 
42  unsigned char d_sf;
43  unsigned char d_sync_word;
44 
45  unsigned short d_fft_size;
46  unsigned char d_interleaver_size;
47 
48  std::vector<gr_complex> d_upchirp;
49  std::vector<gr_complex> d_downchirp;
50 
51  std::vector<gr_complex> d_iq_out;
52 
53  std::ofstream f_mod;
54 
55  public:
56  mod_impl( short spreading_factor, unsigned char d_sync_word);
57  ~mod_impl();
58 
59  void modulate (pmt::pmt_t msg);
60 
61  int general_work(int noutput_items,
62  gr_vector_int &ninput_items,
63  gr_vector_const_void_star &input_items,
64  gr_vector_void_star &output_items);
65  };
66 
67  } // namespace lora
68 } // namespace gr
69 
70 #endif /* INCLUDED_LORA_MOD_IMPL_H */
71 
void modulate(pmt::pmt_t msg)
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
Definition: decode.h:31
Definition: mod_impl.h:37
<+description of block+>
Definition: mod.h:36
mod_impl(short spreading_factor, unsigned char d_sync_word)