blob: 12a9fe0eb55278856c41f1ef96dc7bccb2dde748 [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
Piotr Krysikdc4cb982019-07-16 15:39:11 +020024#ifndef INCLUDED_GSM_FREQ_HOPPER_MSG_H
25#define INCLUDED_GSM_FREQ_HOPPER_MSG_H
Piotr Krysik1a32fc42018-05-11 11:38:07 +020026
27#include <grgsm/api.h>
Piotr Krysikdc4cb982019-07-16 15:39:11 +020028#include <gnuradio/sync_block.h>
Piotr Krysik1a32fc42018-05-11 11:38:07 +020029
30namespace gr {
31 namespace gsm {
32
33 /*!
34 * \brief <+description of block+>
35 * \ingroup gsm
36 *
37 */
Piotr Krysikdc4cb982019-07-16 15:39:11 +020038 class GRGSM_API freq_hopper_msg : virtual public sync_block
Piotr Krysik1a32fc42018-05-11 11:38:07 +020039 {
40 public:
Piotr Krysikdc4cb982019-07-16 15:39:11 +020041 typedef boost::shared_ptr<freq_hopper_msg> sptr;
42
43 static sptr make(
44 double samp_rate = 1e6,
45 double start_fc_rx = 1e9,
46 double start_fc_tx = 1e9,
47 bool rx_hopping=true,
48 bool tx_hopping=true,
49 double freq_change_period=0.0046);
Piotr Krysik1a32fc42018-05-11 11:38:07 +020050
51 /*!
52 * hopping_cmd is a pmt dictionary with following fields:
53 * "cmd": string with type of command, possible values:
54 * -"start" - immediately start hopping or if there is "fn"
55 * field defined start from frame number defined
56 * by that field
57 * -"stop" - immediately stop hopping or if there is "fn"
58 * field defined start from frame number defined
59 * by that field
60 * -"discard" - discard all queued "start_fn" and "stop_fn"
61 * (this command doesn't require hopping parameters or frame number)
62 * "hopping_params": dictionary with hopping parameters in following form:
63 * {"hsn": hopping_sequence_number(uint64),
64 * "ma": mobile_allocation(list of arfcns),
65 * "maio": mobile_allocation_index_offset(uint64),
66 * "n_arfcn": number_of_arfcns_in_ma}
67 * "fn": frame number when to start or stop hopping
68 */
Piotr Krysikdc4cb982019-07-16 15:39:11 +020069// virtual void add_hopping_cmd(pmt::pmt_t hopping_cmd=pmt::PMT_NIL) = 0;
Piotr Krysik1a32fc42018-05-11 11:38:07 +020070 };
71 } // namespace gsm
72} // namespace gr
73
Piotr Krysikdc4cb982019-07-16 15:39:11 +020074#endif /* INCLUDED_GSM_FREQ_HOPPER_MSG_H */