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
35
namespace
gr
{
36
namespace
lora {
37
38
enum
demod_state_t
{
39
S_RESET
,
40
S_PREFILL
,
41
S_DETECT_PREAMBLE
,
42
S_SFD_SYNC
,
43
S_READ_HEADER
,
44
S_READ_PAYLOAD
,
45
S_OUT
46
};
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
api.h
LORA_API
#define LORA_API
Definition:
api.h:30
gr::lora::demod
<+description of block+>
Definition:
demod.h:54
gr::lora::demod::make
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.
gr::lora::demod::sptr
boost::shared_ptr< demod > sptr
Definition:
demod.h:56
gr::lora::demod_state_t
demod_state_t
Definition:
demod.h:38
gr::lora::S_OUT
@ S_OUT
Definition:
demod.h:45
gr::lora::S_READ_PAYLOAD
@ S_READ_PAYLOAD
Definition:
demod.h:44
gr::lora::S_SFD_SYNC
@ S_SFD_SYNC
Definition:
demod.h:42
gr::lora::S_RESET
@ S_RESET
Definition:
demod.h:39
gr::lora::S_DETECT_PREAMBLE
@ S_DETECT_PREAMBLE
Definition:
demod.h:41
gr::lora::S_PREFILL
@ S_PREFILL
Definition:
demod.h:40
gr::lora::S_READ_HEADER
@ S_READ_HEADER
Definition:
demod.h:43
gr
Definition:
decode.h:31
BastilleResearch-gr-lora-d587169
include
lora
demod.h
Generated on Mon Jan 24 2022 06:34:59 for GNU Radio's LORA Package by
1.9.3