ptrkrysik | f8c7e83 | 2015-04-04 12:28:20 +0200 | [diff] [blame] | 1 | /* -*- c++ -*- */ |
| 2 | /* |
| 3 | * @file |
Piotr Krysik | a6268a5 | 2017-08-23 16:02:19 +0200 | [diff] [blame] | 4 | * @author (C) 2015-2017 by Piotr Krysik <ptrkrysik@gmail.com> |
ptrkrysik | f8c7e83 | 2015-04-04 12:28:20 +0200 | [diff] [blame] | 5 | * @section LICENSE |
| 6 | * |
| 7 | * Gr-gsm is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 3, or (at your option) |
| 10 | * any later version. |
| 11 | * |
| 12 | * Gr-gsm is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with gr-gsm; see the file COPYING. If not, write to |
| 19 | * the Free Software Foundation, Inc., 51 Franklin Street, |
| 20 | * Boston, MA 02110-1301, USA. |
| 21 | */ |
| 22 | |
| 23 | #ifndef INCLUDED_GSM_CLOCK_OFFSET_CONTROL_IMPL_H |
| 24 | #define INCLUDED_GSM_CLOCK_OFFSET_CONTROL_IMPL_H |
| 25 | |
| 26 | #include <grgsm/receiver/clock_offset_control.h> |
| 27 | #include <string> |
ptrkrysik | f8c7e83 | 2015-04-04 12:28:20 +0200 | [diff] [blame] | 28 | |
| 29 | namespace gr { |
| 30 | namespace gsm { |
| 31 | class clock_offset_control_impl : public clock_offset_control |
| 32 | { |
| 33 | private: |
| 34 | float d_fc; |
Piotr Krysik | 0982673 | 2016-07-15 13:14:24 +0200 | [diff] [blame] | 35 | float d_samp_rate; |
Piotr Krysik | 83afe73 | 2016-07-17 22:48:35 +0200 | [diff] [blame] | 36 | unsigned int d_osr; |
ptrkrysik | f8c7e83 | 2015-04-04 12:28:20 +0200 | [diff] [blame] | 37 | float d_alfa; |
| 38 | float d_ppm_estimate; |
Piotr Krysik | 0982673 | 2016-07-15 13:14:24 +0200 | [diff] [blame] | 39 | float d_last_ppm_estimate; |
ptrkrysik | f8c7e83 | 2015-04-04 12:28:20 +0200 | [diff] [blame] | 40 | bool d_first_measurement; |
| 41 | int d_counter; |
| 42 | std::string d_last_state; |
ptrkrysik | 32c2116 | 2015-04-04 14:01:52 +0200 | [diff] [blame] | 43 | float d_current_time; |
| 44 | float d_last_fcch_time; |
| 45 | bool d_first_time; |
ptrkrysik | f8c7e83 | 2015-04-04 12:28:20 +0200 | [diff] [blame] | 46 | |
| 47 | void process_measurement(pmt::pmt_t msg); |
Piotr Krysik | 83afe73 | 2016-07-17 22:48:35 +0200 | [diff] [blame] | 48 | void send_ctrl_messages(float freq_offset); |
ptrkrysik | f8c7e83 | 2015-04-04 12:28:20 +0200 | [diff] [blame] | 49 | void timed_reset(); |
| 50 | void reset(); |
| 51 | public: |
Piotr Krysik | 83afe73 | 2016-07-17 22:48:35 +0200 | [diff] [blame] | 52 | clock_offset_control_impl(float fc, float samp_rate, unsigned int osr); |
ptrkrysik | f8c7e83 | 2015-04-04 12:28:20 +0200 | [diff] [blame] | 53 | ~clock_offset_control_impl(); |
| 54 | |
| 55 | virtual void set_fc(float fc); |
Piotr Krysik | 0982673 | 2016-07-15 13:14:24 +0200 | [diff] [blame] | 56 | virtual void set_samp_rate(float samp_rate); |
Piotr Krysik | 83afe73 | 2016-07-17 22:48:35 +0200 | [diff] [blame] | 57 | virtual void set_osr(unsigned int osr); |
ptrkrysik | f8c7e83 | 2015-04-04 12:28:20 +0200 | [diff] [blame] | 58 | }; |
| 59 | } // namespace gsm |
| 60 | } // namespace gr |
| 61 | |
| 62 | #endif /* INCLUDED_GSM_CLOCK_OFFSET_CONTROL_IMPL_H */ |
| 63 | |