blob: eeb3a532b0919376d75c916d74f9e2c91f90722e [file] [log] [blame]
Piotr Krysik1a32fc42018-05-11 11:38:07 +02001/* -*- c++ -*- */
2/* @file
3 * @author Piotr Krysik <ptrkrysik@gmail.com>
4 * @section LICENSE
5 *
6 * Gr-gsm 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-gsm 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-gsm; 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
24#ifndef INCLUDED_GSM_FREQ_HOPPING_H
25#define INCLUDED_GSM_FREQ_HOPPING_H
26
27#include <grgsm/api.h>
28#include <gnuradio/block.h>
29
30namespace gr {
31 namespace gsm {
32
33 /*!
34 * \brief <+description of block+>
35 * \ingroup gsm
36 *
37 */
38 class GRGSM_API freq_hopping : virtual public gr::block
39 {
40 public:
41 typedef boost::shared_ptr<freq_hopping> sptr;
42
43 /*!
44 * hopping_cmd is a pmt dictionary with following fields:
45 * "cmd": string with type of command, possible values:
46 * -"start" - immediately start hopping or if there is "fn"
47 * field defined start from frame number defined
48 * by that field
49 * -"stop" - immediately stop hopping or if there is "fn"
50 * field defined start from frame number defined
51 * by that field
52 * -"discard" - discard all queued "start_fn" and "stop_fn"
53 * (this command doesn't require hopping parameters or frame number)
54 * "hopping_params": dictionary with hopping parameters in following form:
55 * {"hsn": hopping_sequence_number(uint64),
56 * "ma": mobile_allocation(list of arfcns),
57 * "maio": mobile_allocation_index_offset(uint64),
58 * "n_arfcn": number_of_arfcns_in_ma}
59 * "fn": frame number when to start or stop hopping
60 */
61 static sptr make(pmt::pmt_t hopping_cmd);
62 virtual void add_hopping_cmd(pmt::pmt_t hopping_cmd=pmt::PMT_NIL) = 0;
63 };
64 } // namespace gsm
65} // namespace gr
66
67#endif /* INCLUDED_GSM_FREQ_HOPPING_H */
68