GNU Radio's LORA_SDR Package
frame_src.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2020 <+YOU OR YOUR COMPANY+>.
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_SDR_FRAME_SRC_H
23#define INCLUDED_LORA_SDR_FRAME_SRC_H
24
25#include <lora_sdr/api.h>
26#include <gnuradio/sync_block.h>
27
28namespace gr {
29 namespace lora_sdr {
30
31 /*!
32 * \ingroup lora_sdr
33 *
34 */
35 class LORA_SDR_API frame_src : virtual public gr::sync_block
36 {
37 public:
38 typedef std::shared_ptr<frame_src> sptr;
39
40 /*!
41 * \brief Produce frames at a regular interval
42 *
43 * Output frames are composed of 8 upchirps, 2 sync words (8 and 16), 2.25 downchirps and 'pay_len' symbols.
44 * The first frame is output after 'offset' samples and each frame after is spaced of 'delay' samples. If rand_sto is true, the sto will vary
45 * for each frame, with a value uniformly distributed in [0, os_factor*2^sf). Zeros are output between frames. If a file_sink is connected, the payload
46 * will be random for each frame and saved to the file selected. Else a fix payload defined in frame_src_impl.cc will be used.
47 *
48 * \param sf Spreading factor
49 * \param pay_len length of the payload in number of symbols
50 * \param delay number of samples between two frames
51 * \param offset number of samples before the first frame (used to emulate the sampling frequency offset).! The offset of the first user should be smaller than 2^'sf'*'os_factor'!
52 * \param cfo Carrier frequency offset
53 * \param n_frames Number of frames to send
54 * \param os_factor Oversampling factor
55 * \param rand_sto Indicate to use a random sto for each frame
56 */
57 static sptr make(uint8_t sf, int pay_len, int delay, int offset, float cfo, int n_frames, int os_factor, bool rand_sto);
58 };
59
60 } // namespace lora_sdr
61} // namespace gr
62
63#endif /* INCLUDED_LORA_SDR_FRAME_SRC_H */
#define LORA_SDR_API
Definition: api.h:19
Definition: frame_src.h:36
static sptr make(uint8_t sf, int pay_len, int delay, int offset, float cfo, int n_frames, int os_factor, bool rand_sto)
Produce frames at a regular interval.
std::shared_ptr< frame_src > sptr
Definition: frame_src.h:38
Definition: add_crc.h:28