blob: 22860128290a5ca3657dcf61aa79b4bded5b70ed [file] [log] [blame]
Piotr Krysikdc4cb982019-07-16 15:39:11 +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#ifndef INCLUDED_GSM_FREQ_HOPPER_MSG_IMPL_H
24#define INCLUDED_GSM_FREQ_HOPPER_MSG_IMPL_H
25
26#include <grgsm/trx/freq_hopper_msg.h>
27#include <grgsm/misc_utils/time_spec.h>
28#include <grgsm/misc_utils/fn_time.h>
29#include <pmt/pmt.h>
30
31
32namespace gr {
33 namespace gsm {
34
35 class freq_hopper_msg_impl : public freq_hopper_msg
36 {
37 private:
38 double d_samp_rate;
39 double d_fc_rx;
40 double d_fc_tx;
41 bool d_rx_hopping;
42 bool d_tx_hopping;
43 double d_freq_change_period;
44 bool d_rx_time_received;
45 time_spec_t d_last_rx_time;
46 time_spec_t d_current_time;
47 uint64_t d_current_start_offset; //!!zmienic nazwe - ta zmienna okresla pozycje ostatniego rx_time
48 uint64_t d_i;
49 std::vector<double> d_f;
50 double d_start_time;
51 time_spec_t d_next_change_time;
52 double d_change_advance;
53 pmt::pmt_t d_rx_time_key;
54
55// bool d_hopping_enable; //if true block do the hopping, if not block just passes the bursts
56 uint64_t d_hsn; //hopping sequence number
57 uint64_t d_maio; //mobile allocation index offset
58 std::vector<uint64_t> d_ma; //mobile allocation
59
60 uint64_t d_current_fn;//!!
61
62// pmt::pmt_t d_hopping_cmd; //TODO: change this a std::map
63// void set_freq_metadata(pmt::pmt_t cmd);
64// bool set_hopping_params(pmt::pmt_t hopping_params);
65 double get_dsp_freq(uint64_t fn);
66 public:
67 freq_hopper_msg_impl(
68 double samp_rate,
69 double start_fc_rx,
70 double start_fc_tx,
71 bool rx_hopping,
72 bool tx_hopping,
73 double freq_change_period);
74 ~freq_hopper_msg_impl();
75
76 int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
77
78// void add_hopping_cmd(pmt::pmt_t hopping_cmd);
79 };
80
81 } // namespace gsm
82} // namespace gr
83
84#endif /* INCLUDED_GSM_FREQ_HOPPER_MSG_IMPL_H */