Piotr Krysik | 34ce7a0 | 2017-10-31 11:30:59 +0100 | [diff] [blame] | 1 | /* -*- c++ -*- */ |
| 2 | /* @file |
| 3 | * @author Piotr Krysik <ptrkrysik@gmail.com> |
Piotr Krysik | 6e41d06 | 2017-11-03 09:56:49 +0100 | [diff] [blame] | 4 | * @author Vadim Yanitskiy <axilirator@gmail.com> |
Piotr Krysik | 34ce7a0 | 2017-10-31 11:30:59 +0100 | [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 | |
| 24 | |
| 25 | #ifndef INCLUDED_GRGSM_FN_TIME_H |
| 26 | #define INCLUDED_GRGSM_FN_TIME_H |
| 27 | |
Piotr Krysik | 6e41d06 | 2017-11-03 09:56:49 +0100 | [diff] [blame] | 28 | #include <grgsm/api.h> |
Piotr Krysik | 34ce7a0 | 2017-10-31 11:30:59 +0100 | [diff] [blame] | 29 | #include <stdint.h> |
Piotr Krysik | 6e41d06 | 2017-11-03 09:56:49 +0100 | [diff] [blame] | 30 | #include <utility> |
Piotr Krysik | 34ce7a0 | 2017-10-31 11:30:59 +0100 | [diff] [blame] | 31 | |
| 32 | namespace gr { |
| 33 | namespace gsm { |
| 34 | |
| 35 | /** |
| 36 | * Computes difference between reference frame number |
| 37 | * and a second frame number. |
| 38 | * @param fn_ref reference frame number modulo GSM_HYPER_FRAME |
| 39 | * @param fn second frame number modulo GSM_HYPER_FRAME |
| 40 | * @param time_ref precise timestamp of the first sample in the fn_ref |
| 41 | * @param time_hint coarse time for fn that is used as a hint to avoid |
| 42 | * ambiguities caused by modulo operation applied to |
| 43 | * frame numbers |
| 44 | * @return difference between fn_ref and fn |
| 45 | */ |
Piotr Krysik | 6e41d06 | 2017-11-03 09:56:49 +0100 | [diff] [blame] | 46 | typedef std::pair<unsigned long long, double> time_format; |
| 47 | |
| 48 | GRGSM_API time_format fn_time_delta_cpp(uint32_t fn_ref, time_format time_ref, uint32_t fn_x, |
| 49 | time_format time_hint, uint32_t ts_num, uint32_t ts_ref); |
Piotr Krysik | 34ce7a0 | 2017-10-31 11:30:59 +0100 | [diff] [blame] | 50 | |
Piotr Krysik | 6e41d06 | 2017-11-03 09:56:49 +0100 | [diff] [blame] | 51 | } // namespace gsm |
Piotr Krysik | 34ce7a0 | 2017-10-31 11:30:59 +0100 | [diff] [blame] | 52 | } // namespace gr |
| 53 | |
| 54 | #endif /* INCLUDED_GRGSM_FN_TIME_H */ |
| 55 | |