gr-gsm/include/grgsm/misc_utils/fn_time.h

52 lines
1.7 KiB
C++

/* -*- 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 <grgsm/misc_utils/time_spec.h>
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
*/
time_spec_t fn_time_delta2(uint32_t fn_ref, time_spec_t time_ref, uint32_t fn_x,
time_spec_t time_hint, uint32_t ts_num, uint32_t ts_ref);
} // namespace grgsm
} // namespace gr
#endif /* INCLUDED_GRGSM_FN_TIME_H */