laforge
/
openbts-osmo
Archived
1
0
Fork 0

Introduce GSMConfigL1 as base class for GSMConfig

GSMConfigL1 only contains those fields applicable for the Layer1,
while GSMConfig contains all fields for higher layers.
This commit is contained in:
Harald Welte 2011-11-12 16:18:24 +01:00
parent fa05e2e7c4
commit bc570dd885
5 changed files with 138 additions and 30 deletions

View File

@ -36,10 +36,8 @@ using namespace GSM;
GSMConfig::GSMConfig()
:mBand((GSMBand)gConfig.getNum("GSM.Band")),
mSI5Frame(UNIT_DATA),mSI6Frame(UNIT_DATA),
mT3122(gConfig.getNum("GSM.T3122Min")),
mStartTime(::time(NULL))
:mSI5Frame(UNIT_DATA),mSI6Frame(UNIT_DATA),
mT3122(gConfig.getNum("GSM.T3122Min"))
{
regenerateBeacon();
}

View File

@ -32,6 +32,8 @@
#include <ControlCommon.h>
#include <PowerManager.h>
#include "GSMConfigL1.h"
#include "GSML3RRElements.h"
#include "GSML3CommonElements.h"
#include "GSML3RRMessages.h"
@ -54,7 +56,7 @@ class TCHList : public std::vector<TCHFACCHLogicalChannel*> {};
This object carries the top-level GSM air interface configuration.
It serves as a central clearinghouse to get access to everything else in the GSM code.
*/
class GSMConfig {
class GSMConfig : public GSMConfigL1 {
private:
@ -77,16 +79,6 @@ class GSMConfig {
TCHList mTCHPool;
//@}
/**@name BSIC. */
//@{
unsigned mNCC; ///< network color code
unsigned mBCC; ///< basestation color code
//@}
GSMBand mBand; ///< BTS operating band
Clock mClock; ///< local copy of BTS master clock
/**@name Encoded L2 frames to be sent on the BCCH. */
//@{
L2Frame mSI1Frame;
@ -103,8 +95,6 @@ class GSMConfig {
int mT3122;
time_t mStartTime;
L3LocationAreaIdentity mLAI;
bool mHold; ///< If true, do not respond to RACH bursts.
@ -132,22 +122,12 @@ class GSMConfig {
const L3Frame& SI6Frame() const { return mSI6Frame; }
//@}
/** Get the current master clock value. */
Time time() const { return mClock.get(); }
/**@name Accessors. */
//@{
Control::Pager& pager() { return mPager; }
GSMBand band() const { return mBand; }
unsigned BCC() const { return mBCC; }
unsigned NCC() const { return mNCC; }
GSM::Clock& clock() { return mClock; }
const L3LocationAreaIdentity& LAI() const { return mLAI; }
//@}
/** Return the BSIC, NCC:BCC. */
unsigned BSIC() const { return (mNCC<<3) | mBCC; }
/**
Re-encode the L2Frames for system information messages.
Called whenever a beacon parameter is changed.
@ -248,9 +228,6 @@ class GSMConfig {
void createCombinationVII(TransceiverManager &TRX, unsigned CN, unsigned TN);
//@}
/** Return number of seconds since starting. */
time_t uptime() const { return ::time(NULL)-mStartTime; }
/** Get a handle to the power manager. */
PowerManager& powerManager() { return mPowerManager; }
};

View File

@ -0,0 +1,38 @@
/*
* Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
*
* This software is distributed under the terms of the GNU Affero Public License.
* See the COPYING file in the main directory for details.
*
* This use of this software may be subject to additional restrictions.
* See the LEGAL file in the main directory for details.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <Globals.h>
#include "GSMConfigL1.h"
using namespace std;
using namespace GSM;
GSMConfigL1::GSMConfigL1()
:mBand((GSMBand)gConfig.getNum("GSM.Band")),
mStartTime(::time(NULL))
{
}

View File

@ -0,0 +1,93 @@
/*
* Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
*
* This software is distributed under the terms of the GNU Affero Public License.
* See the COPYING file in the main directory for details.
*
* This use of this software may be subject to additional restrictions.
* See the LEGAL file in the main directory for details.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GSMCONFIGL1_H
#define GSMCONFIGL1_H
#include <vector>
#include <PowerManager.h>
#include <TRXManager.h>
#include "GSMCommon.h"
namespace GSM {
/**
This object carries the top-level GSM air interface configuration.
It serves as a central clearinghouse to get access to everything else in the GSM code.
*/
class GSMConfigL1 {
protected:
/**@name BSIC. */
//@{
unsigned mNCC; ///< network color code
unsigned mBCC; ///< basestation color code
//@}
GSMBand mBand; ///< BTS operating band
Clock mClock; ///< local copy of BTS master clock
time_t mStartTime;
public:
/** All parameters come from gConfig. */
GSMConfigL1();
/** Get the current master clock value. */
Time time() const { return mClock.get(); }
/**@name Accessors. */
//@{
GSMBand band() const { return mBand; }
unsigned BCC() const { return mBCC; }
unsigned NCC() const { return mNCC; }
GSM::Clock& clock() { return mClock; }
//@}
/** Return the BSIC, NCC:BCC. */
unsigned BSIC() const { return (mNCC<<3) | mBCC; }
/** Return number of seconds since starting. */
time_t uptime() const { return ::time(NULL)-mStartTime; }
};
}; // GSM
#endif
// vim: ts=4 sw=4

View File

@ -29,6 +29,7 @@ libGSM_la_SOURCES = \
GSM610Tables.cpp \
GSMCommon.cpp \
GSMConfig.cpp \
GSMConfigL1.cpp \
GSML1FEC.cpp \
GSML2LAPDm.cpp \
GSML3CCElements.cpp \
@ -53,6 +54,7 @@ noinst_HEADERS = \
GSM610Tables.h \
GSMCommon.h \
GSMConfig.h \
GSMConfigL1.h \
GSML1FEC.h \
GSML2LAPDm.h \
GSML3CCElements.h \