aboutsummaryrefslogtreecommitdiffstats
path: root/lib/trx/freq_hopper_msg_impl.h
blob: 22860128290a5ca3657dcf61aa79b4bded5b70ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/* -*- c++ -*- */
/* @file
 * @author Piotr Krysik <ptrkrysik@gmail.com>
 * @section LICENSE
 * 
 * Gr-gsm is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3, or (at your option)
 * any later version.
 * 
 * Gr-gsm is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with gr-gsm; see the file COPYING.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street,
 * Boston, MA 02110-1301, USA.
 * 
 */

#ifndef INCLUDED_GSM_FREQ_HOPPER_MSG_IMPL_H
#define INCLUDED_GSM_FREQ_HOPPER_MSG_IMPL_H

#include <grgsm/trx/freq_hopper_msg.h>
#include <grgsm/misc_utils/time_spec.h>
#include <grgsm/misc_utils/fn_time.h>
#include <pmt/pmt.h>


namespace gr {
  namespace gsm {

    class freq_hopper_msg_impl : public freq_hopper_msg
    {
     private:
      double d_samp_rate;
      double d_fc_rx;
      double d_fc_tx;
      bool d_rx_hopping;
      bool d_tx_hopping;
      double d_freq_change_period;
      bool d_rx_time_received;
      time_spec_t d_last_rx_time;
      time_spec_t d_current_time;
      uint64_t d_current_start_offset; //!!zmienic nazwe - ta zmienna okresla pozycje ostatniego rx_time
      uint64_t d_i;
      std::vector<double> d_f;
      double d_start_time;
      time_spec_t d_next_change_time;
      double d_change_advance;
      pmt::pmt_t d_rx_time_key;

//      bool d_hopping_enable; //if true block do the hopping, if not block just passes the bursts
      uint64_t d_hsn; //hopping sequence number
      uint64_t d_maio; //mobile allocation index offset
      std::vector<uint64_t> d_ma; //mobile allocation

      uint64_t d_current_fn;//!!

//      pmt::pmt_t d_hopping_cmd; //TODO: change this a std::map
//      void set_freq_metadata(pmt::pmt_t cmd);
//      bool set_hopping_params(pmt::pmt_t hopping_params);
      double get_dsp_freq(uint64_t fn);
     public:
      freq_hopper_msg_impl(
        double samp_rate,
        double start_fc_rx,
        double start_fc_tx,
        bool rx_hopping,
        bool tx_hopping,
        double freq_change_period);
      ~freq_hopper_msg_impl();

      int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);

//      void add_hopping_cmd(pmt::pmt_t hopping_cmd);
    };

  } // namespace gsm
} // namespace gr

#endif /* INCLUDED_GSM_FREQ_HOPPER_MSG_IMPL_H */