aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPiotr Krysik <ptrkrysik@gmail.com>2017-10-31 11:30:59 +0100
committerPiotr Krysik <ptrkrysik@gmail.com>2017-10-31 11:30:59 +0100
commit34ce7a02f071c0aa4661799aa566236c92955d74 (patch)
treefcc6a4fcc0fbe2680a295b2a3ae25ac2547c2488 /include
parent29ec39b3bd0c03113118f3735b2ea83f0d262844 (diff)
Added C++ version of fn_time
Diffstat (limited to 'include')
-rw-r--r--include/grgsm/misc_utils/CMakeLists.txt3
-rw-r--r--include/grgsm/misc_utils/fn_time.h51
2 files changed, 53 insertions, 1 deletions
diff --git a/include/grgsm/misc_utils/CMakeLists.txt b/include/grgsm/misc_utils/CMakeLists.txt
index 878fcfd..5bfef6a 100644
--- a/include/grgsm/misc_utils/CMakeLists.txt
+++ b/include/grgsm/misc_utils/CMakeLists.txt
@@ -34,5 +34,6 @@ install(FILES
message_printer.h
tmsi_dumper.h
msg_to_tag.h
- controlled_fractional_resampler_cc.h DESTINATION include/grgsm/misc_utils
+ controlled_fractional_resampler_cc.h
+ fn_time.h DESTINATION include/grgsm/misc_utils
)
diff --git a/include/grgsm/misc_utils/fn_time.h b/include/grgsm/misc_utils/fn_time.h
new file mode 100644
index 0000000..240506a
--- /dev/null
+++ b/include/grgsm/misc_utils/fn_time.h
@@ -0,0 +1,51 @@
+/* -*- 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_GRGSM_FN_TIME_H
+#define INCLUDED_GRGSM_FN_TIME_H
+
+#include <stdint.h>
+#include <uhd/types/time_spec.hpp>
+
+namespace gr {
+ namespace gsm {
+
+ /**
+ * Computes difference between reference frame number
+ * and a second frame number.
+ * @param fn_ref reference frame number modulo GSM_HYPER_FRAME
+ * @param fn second frame number modulo GSM_HYPER_FRAME
+ * @param time_ref precise timestamp of the first sample in the fn_ref
+ * @param time_hint coarse time for fn that is used as a hint to avoid
+ * ambiguities caused by modulo operation applied to
+ * frame numbers
+ * @return difference between fn_ref and fn
+ */
+ uhd::time_spec_t fn_time_delta(uint32_t fn_ref, uhd::time_spec_t time_ref, uint32_t fn_x,
+ uhd::time_spec_t time_hint, uint32_t ts_num, uint32_t ts_ref);
+
+ } // namespace grgsm
+} // namespace gr
+
+#endif /* INCLUDED_GRGSM_FN_TIME_H */
+