Changeset 3688

Show
Ignore:
Timestamp:
05/30/2012 07:05:12 PM (12 months ago)
Author:
kurtis.heimerl
Message:

Adding MultiARFCN support to core.

Location:
openbts/trunk
Files:
11 modified

Legend:

Unmodified
Added
Removed
  • openbts/trunk/CLI/CLI.cpp

    r3165 r3688  
    711711        if (argc!=2) return BAD_NUM_ARGS; 
    712712 
    713         int newGain = gTRX.ARFCN()->setRxGain(atoi(argv[1])); 
     713        int newGain = gTRX.ARFCN(0)->setRxGain(atoi(argv[1])); 
    714714        os << "new RX gain is " << newGain << " dB" << endl; 
    715715   
     
    723723        if (argc!=1) return BAD_NUM_ARGS; 
    724724 
    725         int noise = gTRX.ARFCN()->getNoiseLevel(); 
     725        int noise = gTRX.ARFCN(0)->getNoiseLevel(); 
    726726        os << "noise RSSI is -" << noise << " dB wrt full scale" << endl; 
    727727        os << "MS RSSI target is " << gConfig.getNum("GSM.Radio.RSSITarget") << " dB wrt full scale" << endl; 
  • openbts/trunk/GSM/GSMConfig.cpp

    r3165 r3688  
    288288        LOG_ASSERT(TN!=0); 
    289289        LOG(NOTICE) << "Configuring dummy filling on C0T " << TN; 
    290         ARFCNManager *radio = TRX.ARFCN(); 
     290        ARFCNManager *radio = TRX.ARFCN(0); 
    291291        radio->setSlot(TN,0); 
    292292} 
    293293 
    294294 
    295 void GSMConfig::createCombinationI(TransceiverManager& TRX, unsigned TN) 
    296 { 
    297         LOG_ASSERT(TN!=0); 
    298         LOG(NOTICE) << "Configuring combination I on C0T" << TN; 
    299         ARFCNManager *radio = TRX.ARFCN(); 
     295void GSMConfig::createCombinationI(TransceiverManager& TRX, unsigned CN, unsigned TN) 
     296{ 
     297        LOG_ASSERT((CN!=0)||(TN!=0)); 
     298        LOG(NOTICE) << "Configuring combination I on C" << CN << "T" << TN; 
     299        ARFCNManager *radio = TRX.ARFCN(CN); 
    300300        radio->setSlot(TN,1); 
    301         TCHFACCHLogicalChannel* chan = new TCHFACCHLogicalChannel(TN,gTCHF_T[TN]); 
     301        TCHFACCHLogicalChannel* chan = new TCHFACCHLogicalChannel(CN,TN,gTCHF_T[TN]); 
    302302        chan->downstream(radio); 
    303303        Thread* thread = new Thread; 
     
    309309 
    310310 
    311 void GSMConfig::createCombinationVII(TransceiverManager& TRX, unsigned TN) 
    312 { 
    313         LOG_ASSERT(TN!=0); 
    314         LOG(NOTICE) << "Configuring combination VII on C0T" << TN; 
    315         ARFCNManager *radio = TRX.ARFCN(); 
     311void GSMConfig::createCombinationVII(TransceiverManager& TRX, unsigned CN, unsigned TN) 
     312{ 
     313        LOG_ASSERT((CN!=0)||(TN!=0)); 
     314        LOG(NOTICE) << "Configuring combination VII on C" << CN << "T" << TN; 
     315        ARFCNManager *radio = TRX.ARFCN(CN); 
    316316        radio->setSlot(TN,7); 
    317317        for (int i=0; i<8; i++) { 
    318                 SDCCHLogicalChannel* chan = new SDCCHLogicalChannel(TN,gSDCCH8[i]); 
     318                SDCCHLogicalChannel* chan = new SDCCHLogicalChannel(CN,TN,gSDCCH8[i]); 
    319319                chan->downstream(radio); 
    320320                Thread* thread = new Thread; 
  • openbts/trunk/GSM/GSMConfig.h

    r3170 r3688  
    269269        void createCombination0(TransceiverManager &TRX, unsigned TN); 
    270270        /** Combination I is full rate traffic. */ 
    271         void createCombinationI(TransceiverManager &TRX, unsigned TN); 
     271        void createCombinationI(TransceiverManager &TRX, unsigned CN, unsigned TN); 
    272272        /** Combination VII is 8 SDCCHs. */ 
    273         void createCombinationVII(TransceiverManager &TRX, unsigned TN); 
     273        void createCombinationVII(TransceiverManager &TRX, unsigned CN, unsigned TN); 
    274274        //@} 
    275275 
  • openbts/trunk/GSM/GSML1FEC.cpp

    r2324 r3688  
    182182 
    183183 
    184 L1Encoder::L1Encoder(unsigned wTN, const TDMAMapping& wMapping, L1FEC *wParent) 
     184L1Encoder::L1Encoder(unsigned wCN, unsigned wTN, const TDMAMapping& wMapping, L1FEC *wParent) 
    185185        :mDownstream(NULL), 
    186         mTN(wTN), 
     186        mCN(wCN),mTN(wTN), 
    187187        mMapping(wMapping), 
    188188        mTSC(gBTS.BCC()),                               // Note that TSC is hardcoded to the BCC. 
     
    193193        mRunning(false),mActive(false) 
    194194{ 
     195        assert(mCN<gConfig.getNum("GSM.Radio.ARFCNs")); 
    195196        assert(mMapping.allowedSlot(mTN)); 
    196197        assert(mMapping.downlink()); 
     
    201202        ostringstream ss; 
    202203        ss << wMapping.typeAndOffset(); 
    203         sprintf(mDescriptiveString,"C0T%d %s", wTN, ss.str().c_str()); 
     204        sprintf(mDescriptiveString,"C%dT%d %s", wCN, wTN, ss.str().c_str()); 
    204205} 
    205206 
     
    298299        // For Cn, don't do anything. 
    299300        resync(); 
     301        if (mCN!=0) return; 
    300302        for (unsigned i=0; i<mMapping.numFrames(); i++) { 
    301303                mFillerBurst.time(mNextWriteTime); 
     
    523525 
    524526XCCHL1Decoder::XCCHL1Decoder( 
     527                unsigned wCN, 
    525528                unsigned wTN, 
    526529                const TDMAMapping& wMapping, 
    527530                L1FEC *wParent) 
    528         :L1Decoder(wTN,wMapping,wParent), 
     531        :L1Decoder(wCN,wTN,wMapping,wParent), 
    529532        mBlockCoder(0x10004820009ULL, 40, 224), 
    530533        mC(456), mU(228), 
     
    731734 
    732735XCCHL1Encoder::XCCHL1Encoder( 
     736                unsigned wCN, 
    733737                unsigned wTN, 
    734738                const TDMAMapping& wMapping, 
    735739                L1FEC* wParent) 
    736         :L1Encoder(wTN,wMapping,wParent), 
     740        :L1Encoder(wCN,wTN,wMapping,wParent), 
    737741        mBlockCoder(0x10004820009ULL, 40, 224), 
    738742        mC(456), mU(228), 
     
    919923 
    920924SCHL1Encoder::SCHL1Encoder(L1FEC* wParent) 
    921         :GeneratorL1Encoder(0,gSCHMapping,wParent), 
     925        :GeneratorL1Encoder(0,0,gSCHMapping,wParent), 
    922926        mBlockCoder(0x0575,10,25), 
    923927        mU(25+10+4), mE(78), 
     
    966970 
    967971FCCHL1Encoder::FCCHL1Encoder(L1FEC *wParent) 
    968         :GeneratorL1Encoder(0,gFCCHMapping,wParent) 
     972        :GeneratorL1Encoder(0,0,gFCCHMapping,wParent) 
    969973{ 
    970974        mBurst.zero(); 
     
    10371041 
    10381042TCHFACCHL1Decoder::TCHFACCHL1Decoder( 
     1043        unsigned wCN, 
    10391044        unsigned wTN, 
    10401045        const TDMAMapping& wMapping, 
    10411046        L1FEC *wParent) 
    1042         :XCCHL1Decoder(wTN, wMapping, wParent), 
     1047        :XCCHL1Decoder(wCN,wTN, wMapping, wParent), 
    10431048        mTCHU(189),mTCHD(260), 
    10441049        mClass1_c(mC.head(378)),mClass1A_d(mTCHD.head(50)),mClass2_c(mC.segment(378,78)), 
     
    12421247 
    12431248TCHFACCHL1Encoder::TCHFACCHL1Encoder( 
     1249        unsigned wCN, 
    12441250        unsigned wTN, 
    12451251        const TDMAMapping& wMapping, 
    12461252        L1FEC *wParent) 
    1247         :XCCHL1Encoder(wTN, wMapping, wParent),  
     1253        :XCCHL1Encoder(wCN, wTN, wMapping, wParent),  
    12481254        mPreviousFACCH(false),mOffset(0), 
    12491255        mTCHU(189),mTCHD(260), 
     
    15261532 
    15271533 
    1528 SACCHL1Encoder::SACCHL1Encoder(unsigned wTN, const TDMAMapping& wMapping, SACCHL1FEC *wParent) 
    1529         :XCCHL1Encoder(wTN,wMapping,(L1FEC*)wParent), 
     1534SACCHL1Encoder::SACCHL1Encoder(unsigned wCN, unsigned wTN, const TDMAMapping& wMapping, SACCHL1FEC *wParent) 
     1535        :XCCHL1Encoder(wCN,wTN,wMapping,(L1FEC*)wParent), 
    15301536        mSACCHParent(wParent), 
    15311537        mOrderedMSPower(33),mOrderedMSTiming(0) 
  • openbts/trunk/GSM/GSML1FEC.h

    r2324 r3688  
    9393        //@{ 
    9494        const TDMAMapping& mMapping;    ///< multiplexing description 
     95        unsigned mCN;                                   ///< carrier index 
    9596        unsigned mTN;                                   ///< timeslot number to use 
    9697        unsigned mTSC;                                  ///< training sequence for this channel 
     
    120121        /** 
    121122                The basic encoder constructor. 
     123                @param wCN carrier index. 
    122124                @param wTN TDMA timeslot number. 
    123125                @param wMapping TDMA mapping onto the timeslot -- MUST PERSIST. 
    124126                @param wParent The containing L1FEC, for sibling access -- may be NULL. 
    125127        */ 
    126         L1Encoder(unsigned wTN, const TDMAMapping& wMapping, L1FEC *wParent); 
     128        L1Encoder(unsigned wCN, unsigned wTN, const TDMAMapping& wMapping, L1FEC *wParent); 
    127129 
    128130        virtual ~L1Encoder() {} 
     
    140142        /**@name Components of the channel description. */ 
    141143        //@{ 
     144        unsigned CN() const { return mCN; } 
    142145        unsigned TN() const { return mTN; } 
    143146        unsigned TSC() const { return mTSC; } 
     
    232235        /**@name Parameters fixed by the constructor, not requiring mutex protection. */ 
    233236        //@{ 
     237        unsigned mCN;                                   ///< carrier index 
    234238        unsigned mTN;                                   ///< timeslot number  
    235239        const TDMAMapping& mMapping;    ///< demux parameters 
     
    248252                @param wParent The containing L1FEC, for sibling access. 
    249253        */ 
    250         L1Decoder(unsigned wTN, const TDMAMapping& wMapping, L1FEC* wParent) 
     254        L1Decoder(unsigned wCN, unsigned wTN, const TDMAMapping& wMapping, L1FEC* wParent) 
    251255                        :mUpstream(NULL), 
    252256                        mT3101(T3101ms),mT3109(T3109ms),mT3111(T3111ms), 
     
    254258                        mRunning(false), 
    255259                        mFER(0.0F), 
    256                         mTN(wTN), 
     260                        mCN(wCN),mTN(wTN), 
    257261                        mMapping(wMapping),mParent(wParent) 
    258262        { 
     
    383387        unsigned TN() const 
    384388                { assert(mEncoder); return mEncoder->TN(); } 
     389 
     390        unsigned CN() const 
     391                { assert(mEncoder); return mEncoder->CN(); } 
    385392 
    386393        unsigned TSC() const 
     
    459466        RACHL1Decoder(const TDMAMapping &wMapping, 
    460467                L1FEC *wParent) 
    461                 :L1Decoder(0,wMapping,wParent), 
     468                :L1Decoder(0,0,wMapping,wParent), 
    462469                mParity(0x06f,6,8),mU(18),mD(mU.head(8)) 
    463470        { } 
     
    501508        public: 
    502509 
    503         XCCHL1Decoder(unsigned wTN, const TDMAMapping& wMapping, 
     510        XCCHL1Decoder(unsigned wCN, unsigned wTN, const TDMAMapping& wMapping, 
    504511                L1FEC *wParent); 
    505512 
     
    549556 
    550557        SDCCHL1Decoder( 
     558                unsigned wCN, 
    551559                unsigned wTN, 
    552560                const TDMAMapping& wMapping, 
    553561                L1FEC *wParent) 
    554                 :XCCHL1Decoder(wTN,wMapping,wParent) 
     562                :XCCHL1Decoder(wCN,wTN,wMapping,wParent) 
    555563        { } 
    556564 
     
    580588 
    581589        SACCHL1Decoder( 
     590                unsigned wCN, 
    582591                unsigned wTN, 
    583592                const TDMAMapping& wMapping, 
    584593                SACCHL1FEC *wParent) 
    585                 :XCCHL1Decoder(wTN,wMapping,(L1FEC*)wParent), 
     594                :XCCHL1Decoder(wCN,wTN,wMapping,(L1FEC*)wParent), 
    586595                mSACCHParent(wParent), 
    587596                mRSSICounter(0) 
     
    654663 
    655664        XCCHL1Encoder( 
     665                unsigned wCN, 
    656666                unsigned wTN, 
    657667                const TDMAMapping& wMapping, 
     
    721731public: 
    722732 
    723         TCHFACCHL1Encoder(unsigned wTN,  
     733        TCHFACCHL1Encoder(unsigned wCN, unsigned wTN,  
    724734                          const TDMAMapping& wMapping, 
    725735                          L1FEC* wParent); 
     
    781791        public: 
    782792 
    783         TCHFACCHL1Decoder(unsigned wTN,  
     793        TCHFACCHL1Decoder(unsigned wCN, unsigned wTN,  
    784794                           const TDMAMapping& wMapping, 
    785795                           L1FEC *wParent); 
     
    837847 
    838848        GeneratorL1Encoder(      
     849                unsigned wCN, 
    839850                unsigned wTN, 
    840851                const TDMAMapping& wMapping, 
    841852                L1FEC* wParent) 
    842                 :L1Encoder(wTN,wMapping,wParent) 
     853                :L1Encoder(wCN,wTN,wMapping,wParent) 
    843854        { } 
    844855 
     
    925936 
    926937        NDCCHL1Encoder( 
     938                unsigned wCN, 
    927939                unsigned wTN, 
    928940                const TDMAMapping& wMapping, 
    929941                L1FEC *wParent) 
    930                 :XCCHL1Encoder(wTN, wMapping, wParent) 
     942                :XCCHL1Encoder(wCN, wTN, wMapping, wParent) 
    931943        { } 
    932944 
     
    955967 
    956968        BCCHL1Encoder(L1FEC *wParent) 
    957                 :NDCCHL1Encoder(0,gBCCHMapping,wParent) 
     969                :NDCCHL1Encoder(0,0,gBCCHMapping,wParent) 
    958970        {} 
    959971 
     
    984996        public: 
    985997 
    986         SACCHL1Encoder(unsigned wTN, const TDMAMapping& wMapping, SACCHL1FEC *wParent); 
     998        SACCHL1Encoder(unsigned wCN, unsigned wTN, const TDMAMapping& wMapping, SACCHL1FEC *wParent); 
    987999 
    9881000        void orderedMSPower(int power) { mOrderedMSPower = power; } 
     
    10221034        CCCHL1Encoder(const TDMAMapping& wMapping, 
    10231035                        L1FEC* wParent) 
    1024                 :XCCHL1Encoder(0,wMapping,wParent) 
     1036                :XCCHL1Encoder(0,0,wMapping,wParent) 
    10251037        {} 
    10261038 
     
    10281040 
    10291041 
     1042/** Cell Broadcast Channel (CBCH). */ 
     1043class CBCHL1Encoder : public XCCHL1Encoder { 
     1044 
     1045        public: 
     1046 
     1047        CBCHL1Encoder(const TDMAMapping& wMapping, 
     1048                        L1FEC* wParent) 
     1049                :XCCHL1Encoder(0,0,wMapping,wParent) 
     1050        {} 
     1051 
     1052        /** Override sendFrame to meet sync requirements of GSM 05.02 6.5.4. */ 
     1053        virtual void sendFrame(const L2Frame&); 
     1054 
     1055}; 
     1056 
     1057 
     1058 
    10301059 
    10311060 
     
    10361065 
    10371066        SDCCHL1FEC( 
     1067                unsigned wCN, 
    10381068                unsigned wTN, 
    10391069                const MappingPair& wMapping) 
    10401070                :L1FEC() 
    10411071        { 
    1042                 mEncoder = new SDCCHL1Encoder(wTN,wMapping.downlink(),this); 
    1043                 mDecoder = new SDCCHL1Decoder(wTN,wMapping.uplink(),this); 
    1044         } 
    1045 }; 
    1046  
     1072                mEncoder = new SDCCHL1Encoder(wCN,wTN,wMapping.downlink(),this); 
     1073                mDecoder = new SDCCHL1Decoder(wCN,wTN,wMapping.uplink(),this); 
     1074        } 
     1075}; 
     1076 
     1077 
     1078 
     1079 
     1080 
     1081 
     1082class CBCHL1FEC : public L1FEC { 
     1083 
     1084        public: 
     1085 
     1086        CBCHL1FEC(const MappingPair& wMapping) 
     1087                :L1FEC() 
     1088        { 
     1089                mEncoder = new CBCHL1Encoder(wMapping.downlink(),this); 
     1090        } 
     1091}; 
    10471092 
    10481093 
     
    10661111 
    10671112        TCHFACCHL1FEC( 
     1113                unsigned wCN, 
    10681114                unsigned wTN, 
    10691115                const MappingPair& wMapping) 
    10701116                :L1FEC() 
    10711117        { 
    1072                 mTCHEncoder = new TCHFACCHL1Encoder(wTN, wMapping.downlink(), this ); 
     1118                mTCHEncoder = new TCHFACCHL1Encoder(wCN, wTN, wMapping.downlink(), this ); 
    10731119                mEncoder = mTCHEncoder; 
    1074                 mTCHDecoder = new TCHFACCHL1Decoder(wTN, wMapping.uplink(), this );      
     1120                mTCHDecoder = new TCHFACCHL1Decoder(wCN, wTN, wMapping.uplink(), this );         
    10751121                mDecoder = mTCHDecoder; 
    10761122        } 
     
    11081154 
    11091155        SACCHL1FEC( 
     1156                unsigned wCN, 
    11101157                unsigned wTN, 
    11111158                const MappingPair& wMapping) 
    11121159                :L1FEC() 
    11131160        { 
    1114                 mSACCHEncoder = new SACCHL1Encoder(wTN,wMapping.downlink(),this); 
     1161                mSACCHEncoder = new SACCHL1Encoder(wCN,wTN,wMapping.downlink(),this); 
    11151162                mEncoder = mSACCHEncoder; 
    1116                 mSACCHDecoder = new SACCHL1Decoder(wTN,wMapping.uplink(),this); 
     1163                mSACCHDecoder = new SACCHL1Decoder(wCN,wTN,wMapping.uplink(),this); 
    11171164                mDecoder = mSACCHDecoder; 
    11181165        } 
     
    11431190        public: 
    11441191 
    1145         LoopbackL1FEC(unsigned wTN) 
     1192        LoopbackL1FEC(unsigned wCN, unsigned wTN) 
    11461193                :L1FEC() 
    11471194        { 
    1148                 mEncoder = new XCCHL1Encoder(wTN,gLoopbackTestFullMapping,this); 
    1149                 mDecoder = new SDCCHL1Decoder(wTN,gLoopbackTestFullMapping,this); 
     1195                mEncoder = new XCCHL1Encoder(wCN,wTN,gLoopbackTestFullMapping,this); 
     1196                mDecoder = new SDCCHL1Decoder(wCN,wTN,gLoopbackTestFullMapping,this); 
    11501197        } 
    11511198}; 
  • openbts/trunk/GSM/GSMLogicalChannel.cpp

    r2242 r3688  
    164164 
    165165SDCCHLogicalChannel::SDCCHLogicalChannel( 
     166                unsigned wCN, 
    166167                unsigned wTN, 
    167168                const CompleteMapping& wMapping) 
    168169{ 
    169         mL1 = new SDCCHL1FEC(wTN,wMapping.LCH()); 
     170        mL1 = new SDCCHL1FEC(wCN,wTN,wMapping.LCH()); 
    170171        // SAP0 is RR/MM/CC, SAP3 is SMS 
    171172        // SAP1 and SAP2 are not used. 
     
    176177        mL2[0] = SAP0L2; 
    177178        mL2[3] = SAP3L2; 
    178         mSACCH = new SACCHLogicalChannel(wTN,wMapping.SACCH()); 
     179        mSACCH = new SACCHLogicalChannel(wCN,wTN,wMapping.SACCH()); 
    179180        connect(); 
    180181} 
     
    185186 
    186187SACCHLogicalChannel::SACCHLogicalChannel( 
     188                unsigned wCN, 
    187189                unsigned wTN, 
    188190                const MappingPair& wMapping) 
    189191                : mRunning(false) 
    190192{ 
    191         mSACCHL1 = new SACCHL1FEC(wTN,wMapping); 
     193        mSACCHL1 = new SACCHL1FEC(wCN,wTN,wMapping); 
    192194        mL1 = mSACCHL1; 
    193195        // SAP0 is RR, SAP3 is SMS 
     
    350352 
    351353TCHFACCHLogicalChannel::TCHFACCHLogicalChannel( 
     354                unsigned wCN, 
    352355                unsigned wTN, 
    353356                const CompleteMapping& wMapping) 
    354357{ 
    355         mTCHL1 = new TCHFACCHL1FEC(wTN,wMapping.LCH()); 
     358        mTCHL1 = new TCHFACCHL1FEC(wCN,wTN,wMapping.LCH()); 
    356359        mL1 = mTCHL1; 
    357360        // SAP0 is RR/MM/CC, SAP3 is SMS 
     
    359362        mL2[0] = new FACCHL2(1,0); 
    360363        mL2[3] = new FACCHL2(1,3); 
    361         mSACCH = new SACCHLogicalChannel(wTN,wMapping.SACCH()); 
     364        mSACCH = new SACCHLogicalChannel(wCN,wTN,wMapping.SACCH()); 
    362365        connect(); 
    363366} 
  • openbts/trunk/GSM/GSMLogicalChannel.h

    r2305 r3688  
    221221        //@{ 
    222222        /** Carrier index. */ 
    223         unsigned CN() const { return 0; } 
     223        unsigned CN() const { assert(mL1); return mL1->CN(); } 
    224224        /** Slot number. */ 
    225225        unsigned TN() const { assert(mL1); return mL1->TN(); } 
     
    297297         
    298298        SDCCHLogicalChannel( 
     299                unsigned wCN, 
    299300                unsigned wTN, 
    300301                const CompleteMapping& wMapping); 
     
    361362 
    362363        SACCHLogicalChannel( 
     364                unsigned wCN, 
    363365                unsigned wTN, 
    364366                const MappingPair& wMapping); 
     
    467469 
    468470        TCHFACCHLogicalChannel( 
     471                unsigned wCN, 
    469472                unsigned wTN, 
    470473                const CompleteMapping& wMapping); 
     
    532535        public :  
    533536      SDCCHLogicalChannel_LB( 
     537                unsigned wCN, 
    534538                unsigned wTN, 
    535539                const CompleteMapping& wMapping); 
     
    542546        /** Custom constructor, L2 is Uplink instead of downlink. */ 
    543547        TCHFACCHLogicalChannel_UPLINK( 
     548                unsigned wCN, 
    544549                unsigned wTN,  
    545550                const CompleteMapping& wMapping); 
  • openbts/trunk/GSM/PowerManager.cpp

    r2242 r3688  
    125125void PowerManager::start() 
    126126{ 
    127         mRadio = gTRX.ARFCN(); 
     127        mRadio = gTRX.ARFCN(0); 
    128128        mRadio->setPower(mAtten); 
    129129        mThread.start((void*(*)(void*))PowerManagerServiceLoopAdapter,this); 
  • openbts/trunk/TRXManager/TRXManager.cpp

    r2242 r3688  
    4646 
    4747 
    48 TransceiverManager::TransceiverManager(const char* wTRXAddress, int wBasePort) 
     48TransceiverManager::TransceiverManager(int numARFCNs, 
     49                const char* wTRXAddress, int wBasePort) 
    4950        :mHaveClock(false), 
    5051        mClockSocket(wBasePort+100) 
    5152{ 
    52         // set up the ARFCN manager 
    53         mARFCN = new ::ARFCNManager(wTRXAddress,wBasePort+1,*this); 
     53        // set up the ARFCN managers 
     54        for (int i=0; i<numARFCNs; i++) { 
     55                int thisBasePort = wBasePort + 1 + 2*i; 
     56                mARFCNs.push_back(new ::ARFCNManager(wTRXAddress,thisBasePort,*this)); 
     57        } 
    5458} 
    5559 
     
    5963{ 
    6064        mClockThread.start((void*(*)(void*))ClockLoopAdapter,this); 
    61         mARFCN->start(); 
     65        for (unsigned i=0; i<mARFCNs.size(); i++) { 
     66                mARFCNs[i]->start(); 
     67        } 
    6268} 
    6369 
  • openbts/trunk/TRXManager/TRXManager.h

    r2305 r3688  
    5959        private: 
    6060 
    61         /// the ARFCN mananger under this TRX 
    62         ARFCNManager* mARFCN; 
     61        /// the ARFCN manangers under this TRX 
     62        std::vector<ARFCNManager*> mARFCNs;              
    6363 
    6464        /// set true when the first CLOCK packet is received 
     
    7474        /** 
    7575                Construct a TransceiverManager. 
     76                @param numARFCNs Number of ARFCNs supported by the transceiver. 
    7677                @param wTRXAddress IP address of the transceiver. 
    7778                @param wBasePort The base port for the interface, as defined in README.TRX. 
    7879        */ 
    79         TransceiverManager(const char* wTRXAddress, int wBasePort); 
     80        TransceiverManager(int numARFCNs, 
     81                const char* wTRXAddress, int wBasePort); 
    8082 
    8183        /**@name Accessors. */ 
    8284        //@{ 
    83         ARFCNManager* ARFCN() { return mARFCN; } 
     85        ARFCNManager* ARFCN(unsigned i) { assert(i<mARFCNs.size()); return mARFCNs.at(i); } 
    8486        //@} 
     87 
     88        unsigned numARFCNs() const { return mARFCNs.size(); } 
     89 
     90        /** Block until the clock is set over the UDP link. */ 
     91        //void waitForClockInit() const; 
    8592 
    8693        /** Start the clock management thread and all ARFCN managers. */ 
  • openbts/trunk/apps/OpenBTS.cpp

    r3165 r3688  
    9292 
    9393// Our interface to the software-defined radio. 
    94 TransceiverManager gTRX(gConfig.getStr("TRX.IP").c_str(), gConfig.getNum("TRX.Port")); 
     94TransceiverManager gTRX(gConfig.getNum("GSM.Radio.ARFCNs"), gConfig.getStr("TRX.IP").c_str(), gConfig.getNum("TRX.Port")); 
    9595 
    9696// Subscriber registry 
     
    117117        // If the path is not defined, the transceiver must be started by some other process. 
    118118        char TRXnumARFCN[4]; 
    119         sprintf(TRXnumARFCN,"%1d",1); 
     119        sprintf(TRXnumARFCN,"%1d",gConfig.getNum("GSM.Radio.ARFCNs")); 
    120120        LOG(NOTICE) << "starting transceiver " << transceiverPath << " " << TRXnumARFCN; 
    121121        gTransceiverPid = vfork(); 
     
    176176        // Set up the interface to the radio. 
    177177        // Get a handle to the C0 transceiver interface. 
    178         ARFCNManager* C0radio = gTRX.ARFCN(); 
     178        ARFCNManager* C0radio = gTRX.ARFCN(0); 
    179179 
    180180        // Tuning. 
     
    183183        // Get the ARFCN list. 
    184184        unsigned C0 = gConfig.getNum("GSM.Radio.C0"); 
    185         // Tune the radio. 
    186         LOG(INFO) << "tuning TRX to ARFCN " << C0; 
    187         ARFCNManager* radio = gTRX.ARFCN(); 
    188         radio->tune(C0); 
     185        unsigned numARFCNs = gConfig.getNum("GSM.Radio.ARFCNs"); 
     186        for (unsigned i=0; i<numARFCNs; i++) { 
     187                // Tune the radios. 
     188                unsigned ARFCN = C0 + i*2; 
     189                LOG(INFO) << "tuning TRX " << i << " to ARFCN " << ARFCN; 
     190                ARFCNManager* radio = gTRX.ARFCN(i); 
     191                radio->tune(ARFCN); 
     192        } 
    189193 
    190194        // Set TSC same as BCC everywhere. 
     
    240244        // C-V C0T0 SDCCHs 
    241245        SDCCHLogicalChannel C0T0SDCCH[4] = { 
    242                 SDCCHLogicalChannel(0,gSDCCH_4_0), 
    243                 SDCCHLogicalChannel(0,gSDCCH_4_1), 
    244                 SDCCHLogicalChannel(0,gSDCCH_4_2), 
    245                 SDCCHLogicalChannel(0,gSDCCH_4_3), 
     246                SDCCHLogicalChannel(0,0,gSDCCH_4_0), 
     247                SDCCHLogicalChannel(0,0,gSDCCH_4_1), 
     248                SDCCHLogicalChannel(0,0,gSDCCH_4_2), 
     249                SDCCHLogicalChannel(0,0,gSDCCH_4_3), 
    246250        }; 
    247251        Thread C0T0SDCCHControlThread[4]; 
     
    264268                // Create C-I slots. 
    265269                for (int i=0; i<gConfig.getNum("GSM.Channels.NumC1s"); i++) { 
    266                         gBTS.createCombinationI(gTRX,sCount); 
     270                        gBTS.createCombinationI(gTRX,sCount/8,sCount%8); 
    267271                        sCount++; 
    268272                } 
     
    271275        // Create C-VII slots. 
    272276        for (int i=0; i<gConfig.getNum("GSM.Channels.NumC7s"); i++) { 
    273                 gBTS.createCombinationVII(gTRX,sCount); 
     277                gBTS.createCombinationVII(gTRX,sCount/8,sCount%8); 
    274278                sCount++; 
    275279        } 
     
    278282                // Create C-I slots. 
    279283                for (int i=0; i<gConfig.getNum("GSM.Channels.NumC1s"); i++) { 
    280                         gBTS.createCombinationI(gTRX,sCount); 
     284                        gBTS.createCombinationI(gTRX,sCount/8,sCount%8); 
    281285                        sCount++; 
    282286                }