GNU Radio's LORA Package
demod.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
22#ifndef INCLUDED_LORA_DEMOD_H
23#define INCLUDED_LORA_DEMOD_H
24
25#include <lora/api.h>
26#include <gnuradio/block.h>
27
28#define DEMOD_HISTORY_DEPTH 3
29#define REQUIRED_PREAMBLE_CHIRPS 4
30#define REQUIRED_SFD_CHIRPS 2
31#define LORA_SFD_TOLERANCE 1
32#define LORA_PREAMBLE_TOLERANCE 1
33#define DEMOD_SYNC_RECOVERY_COUNT (8-REQUIRED_PREAMBLE_CHIRPS)+(2-REQUIRED_SFD_CHIRPS)+4
34
35namespace gr {
36 namespace lora {
37
47
48 /*!
49 * \brief <+description of block+>
50 * \ingroup lora
51 *
52 */
53 class LORA_API demod : virtual public gr::block
54 {
55 public:
56 typedef boost::shared_ptr<demod> sptr;
57
58 /*!
59 * \brief Return a shared_ptr to a new instance of lora::demod.
60 *
61 * To avoid accidental use of raw pointers, lora::demod's
62 * constructor is in a private implementation
63 * class. lora::demod::make is the public interface for
64 * creating new instances.
65 */
66 static sptr make( unsigned short spreading_factor,
67 bool low_data_rate,
68 float beta,
69 unsigned short fft_factor);
70 };
71
72 } // namespace lora
73} // namespace gr
74
75#endif /* INCLUDED_LORA_DEMOD_H */
76
#define LORA_API
Definition api.h:30
<+description of block+>
Definition demod.h:54
static sptr make(unsigned short spreading_factor, bool low_data_rate, float beta, unsigned short fft_factor)
Return a shared_ptr to a new instance of lora::demod.
boost::shared_ptr< demod > sptr
Definition demod.h:56
demod_state_t
Definition demod.h:38
@ S_OUT
Definition demod.h:45
@ S_READ_PAYLOAD
Definition demod.h:44
@ S_SFD_SYNC
Definition demod.h:42
@ S_RESET
Definition demod.h:39
@ S_DETECT_PREAMBLE
Definition demod.h:41
@ S_PREFILL
Definition demod.h:40
@ S_READ_HEADER
Definition demod.h:43
Definition decode.h:31