diff --git a/public-trunk/GSM/GSMConfig.cpp b/public-trunk/GSM/GSMConfig.cpp index fc7ab88..2c5d56c 100644 --- a/public-trunk/GSM/GSMConfig.cpp +++ b/public-trunk/GSM/GSMConfig.cpp @@ -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(); } diff --git a/public-trunk/GSM/GSMConfig.h b/public-trunk/GSM/GSMConfig.h index ff7e83c..ec69ab1 100644 --- a/public-trunk/GSM/GSMConfig.h +++ b/public-trunk/GSM/GSMConfig.h @@ -32,6 +32,8 @@ #include #include +#include "GSMConfigL1.h" + #include "GSML3RRElements.h" #include "GSML3CommonElements.h" #include "GSML3RRMessages.h" @@ -54,7 +56,7 @@ class TCHList : public std::vector {}; 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; } }; diff --git a/public-trunk/GSM/GSMConfigL1.cpp b/public-trunk/GSM/GSMConfigL1.cpp new file mode 100644 index 0000000..c3d405f --- /dev/null +++ b/public-trunk/GSM/GSMConfigL1.cpp @@ -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 . + +*/ + + + +#include + +#include "GSMConfigL1.h" + +using namespace std; +using namespace GSM; + +GSMConfigL1::GSMConfigL1() + :mBand((GSMBand)gConfig.getNum("GSM.Band")), + mStartTime(::time(NULL)) +{ +} diff --git a/public-trunk/GSM/GSMConfigL1.h b/public-trunk/GSM/GSMConfigL1.h new file mode 100644 index 0000000..4f7a947 --- /dev/null +++ b/public-trunk/GSM/GSMConfigL1.h @@ -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 . + +*/ + + + +#ifndef GSMCONFIGL1_H +#define GSMCONFIGL1_H + +#include + +#include +#include + +#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 diff --git a/public-trunk/GSM/Makefile.am b/public-trunk/GSM/Makefile.am index bcb3b35..9014ac4 100644 --- a/public-trunk/GSM/Makefile.am +++ b/public-trunk/GSM/Makefile.am @@ -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 \