blob: 29cd3e5d795347799473e44bcd521272ac77bb40 [file] [log] [blame]
Holger Hans Peter Freytherb6acfda2013-10-17 19:41:11 +02001/*
2 * Copyright (C) 2013 by Holger Hans Peter Freyther
3 *
4 * All Rights Reserved
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#include <bts.h>
Holger Hans Peter Freytherb78adcd2013-10-17 20:12:37 +020022#include <poll_controller.h>
23
Holger Hans Peter Freytherb6acfda2013-10-17 19:41:11 +020024#include <string.h>
25
26static BTS s_bts;
27
28BTS* BTS::main_bts()
29{
30 return &s_bts;
31}
32
33struct gprs_rlcmac_bts *BTS::bts_data()
34{
35 return &m_bts;
36}
37
38struct gprs_rlcmac_bts *bts_main_data()
39{
40 return BTS::main_bts()->bts_data();
41}
42
43BTS::BTS()
Holger Hans Peter Freyther9b30c7f2013-10-17 19:59:56 +020044 : m_cur_fn(0)
Holger Hans Peter Freytherb78adcd2013-10-17 20:12:37 +020045 , m_pollController(*this)
Holger Hans Peter Freytherb6acfda2013-10-17 19:41:11 +020046{
47 memset(&m_bts, 0, sizeof(m_bts));
48 m_bts.bts = this;
49}
Holger Hans Peter Freyther9b30c7f2013-10-17 19:59:56 +020050
51void BTS::set_current_frame_number(int fn)
52{
53 m_cur_fn = fn;
Holger Hans Peter Freytherb78adcd2013-10-17 20:12:37 +020054 m_pollController.expireTimedout(m_cur_fn);
Holger Hans Peter Freyther9b30c7f2013-10-17 19:59:56 +020055}