Changeset 3688
- Timestamp:
- 05/30/2012 07:05:12 PM (12 months ago)
- Location:
- openbts/trunk
- Files:
-
- 11 modified
-
CLI/CLI.cpp (modified) (2 diffs)
-
GSM/GSMConfig.cpp (modified) (2 diffs)
-
GSM/GSMConfig.h (modified) (1 diff)
-
GSM/GSML1FEC.cpp (modified) (11 diffs)
-
GSM/GSML1FEC.h (modified) (24 diffs)
-
GSM/GSMLogicalChannel.cpp (modified) (5 diffs)
-
GSM/GSMLogicalChannel.h (modified) (6 diffs)
-
GSM/PowerManager.cpp (modified) (1 diff)
-
TRXManager/TRXManager.cpp (modified) (2 diffs)
-
TRXManager/TRXManager.h (modified) (2 diffs)
-
apps/OpenBTS.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
openbts/trunk/CLI/CLI.cpp
r3165 r3688 711 711 if (argc!=2) return BAD_NUM_ARGS; 712 712 713 int newGain = gTRX.ARFCN( )->setRxGain(atoi(argv[1]));713 int newGain = gTRX.ARFCN(0)->setRxGain(atoi(argv[1])); 714 714 os << "new RX gain is " << newGain << " dB" << endl; 715 715 … … 723 723 if (argc!=1) return BAD_NUM_ARGS; 724 724 725 int noise = gTRX.ARFCN( )->getNoiseLevel();725 int noise = gTRX.ARFCN(0)->getNoiseLevel(); 726 726 os << "noise RSSI is -" << noise << " dB wrt full scale" << endl; 727 727 os << "MS RSSI target is " << gConfig.getNum("GSM.Radio.RSSITarget") << " dB wrt full scale" << endl; -
openbts/trunk/GSM/GSMConfig.cpp
r3165 r3688 288 288 LOG_ASSERT(TN!=0); 289 289 LOG(NOTICE) << "Configuring dummy filling on C0T " << TN; 290 ARFCNManager *radio = TRX.ARFCN( );290 ARFCNManager *radio = TRX.ARFCN(0); 291 291 radio->setSlot(TN,0); 292 292 } 293 293 294 294 295 void GSMConfig::createCombinationI(TransceiverManager& TRX, unsigned TN)296 { 297 LOG_ASSERT( TN!=0);298 LOG(NOTICE) << "Configuring combination I on C 0T" << TN;299 ARFCNManager *radio = TRX.ARFCN( );295 void 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); 300 300 radio->setSlot(TN,1); 301 TCHFACCHLogicalChannel* chan = new TCHFACCHLogicalChannel( TN,gTCHF_T[TN]);301 TCHFACCHLogicalChannel* chan = new TCHFACCHLogicalChannel(CN,TN,gTCHF_T[TN]); 302 302 chan->downstream(radio); 303 303 Thread* thread = new Thread; … … 309 309 310 310 311 void GSMConfig::createCombinationVII(TransceiverManager& TRX, unsigned TN)312 { 313 LOG_ASSERT( TN!=0);314 LOG(NOTICE) << "Configuring combination VII on C 0T" << TN;315 ARFCNManager *radio = TRX.ARFCN( );311 void 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); 316 316 radio->setSlot(TN,7); 317 317 for (int i=0; i<8; i++) { 318 SDCCHLogicalChannel* chan = new SDCCHLogicalChannel( TN,gSDCCH8[i]);318 SDCCHLogicalChannel* chan = new SDCCHLogicalChannel(CN,TN,gSDCCH8[i]); 319 319 chan->downstream(radio); 320 320 Thread* thread = new Thread; -
openbts/trunk/GSM/GSMConfig.h
r3170 r3688 269 269 void createCombination0(TransceiverManager &TRX, unsigned TN); 270 270 /** Combination I is full rate traffic. */ 271 void createCombinationI(TransceiverManager &TRX, unsigned TN);271 void createCombinationI(TransceiverManager &TRX, unsigned CN, unsigned TN); 272 272 /** Combination VII is 8 SDCCHs. */ 273 void createCombinationVII(TransceiverManager &TRX, unsigned TN);273 void createCombinationVII(TransceiverManager &TRX, unsigned CN, unsigned TN); 274 274 //@} 275 275 -
openbts/trunk/GSM/GSML1FEC.cpp
r2324 r3688 182 182 183 183 184 L1Encoder::L1Encoder(unsigned w TN, const TDMAMapping& wMapping, L1FEC *wParent)184 L1Encoder::L1Encoder(unsigned wCN, unsigned wTN, const TDMAMapping& wMapping, L1FEC *wParent) 185 185 :mDownstream(NULL), 186 m TN(wTN),186 mCN(wCN),mTN(wTN), 187 187 mMapping(wMapping), 188 188 mTSC(gBTS.BCC()), // Note that TSC is hardcoded to the BCC. … … 193 193 mRunning(false),mActive(false) 194 194 { 195 assert(mCN<gConfig.getNum("GSM.Radio.ARFCNs")); 195 196 assert(mMapping.allowedSlot(mTN)); 196 197 assert(mMapping.downlink()); … … 201 202 ostringstream ss; 202 203 ss << wMapping.typeAndOffset(); 203 sprintf(mDescriptiveString,"C 0T%d %s", wTN, ss.str().c_str());204 sprintf(mDescriptiveString,"C%dT%d %s", wCN, wTN, ss.str().c_str()); 204 205 } 205 206 … … 298 299 // For Cn, don't do anything. 299 300 resync(); 301 if (mCN!=0) return; 300 302 for (unsigned i=0; i<mMapping.numFrames(); i++) { 301 303 mFillerBurst.time(mNextWriteTime); … … 523 525 524 526 XCCHL1Decoder::XCCHL1Decoder( 527 unsigned wCN, 525 528 unsigned wTN, 526 529 const TDMAMapping& wMapping, 527 530 L1FEC *wParent) 528 :L1Decoder(w TN,wMapping,wParent),531 :L1Decoder(wCN,wTN,wMapping,wParent), 529 532 mBlockCoder(0x10004820009ULL, 40, 224), 530 533 mC(456), mU(228), … … 731 734 732 735 XCCHL1Encoder::XCCHL1Encoder( 736 unsigned wCN, 733 737 unsigned wTN, 734 738 const TDMAMapping& wMapping, 735 739 L1FEC* wParent) 736 :L1Encoder(w TN,wMapping,wParent),740 :L1Encoder(wCN,wTN,wMapping,wParent), 737 741 mBlockCoder(0x10004820009ULL, 40, 224), 738 742 mC(456), mU(228), … … 919 923 920 924 SCHL1Encoder::SCHL1Encoder(L1FEC* wParent) 921 :GeneratorL1Encoder(0, gSCHMapping,wParent),925 :GeneratorL1Encoder(0,0,gSCHMapping,wParent), 922 926 mBlockCoder(0x0575,10,25), 923 927 mU(25+10+4), mE(78), … … 966 970 967 971 FCCHL1Encoder::FCCHL1Encoder(L1FEC *wParent) 968 :GeneratorL1Encoder(0, gFCCHMapping,wParent)972 :GeneratorL1Encoder(0,0,gFCCHMapping,wParent) 969 973 { 970 974 mBurst.zero(); … … 1037 1041 1038 1042 TCHFACCHL1Decoder::TCHFACCHL1Decoder( 1043 unsigned wCN, 1039 1044 unsigned wTN, 1040 1045 const TDMAMapping& wMapping, 1041 1046 L1FEC *wParent) 1042 :XCCHL1Decoder(w TN, wMapping, wParent),1047 :XCCHL1Decoder(wCN,wTN, wMapping, wParent), 1043 1048 mTCHU(189),mTCHD(260), 1044 1049 mClass1_c(mC.head(378)),mClass1A_d(mTCHD.head(50)),mClass2_c(mC.segment(378,78)), … … 1242 1247 1243 1248 TCHFACCHL1Encoder::TCHFACCHL1Encoder( 1249 unsigned wCN, 1244 1250 unsigned wTN, 1245 1251 const TDMAMapping& wMapping, 1246 1252 L1FEC *wParent) 1247 :XCCHL1Encoder(w TN, wMapping, wParent),1253 :XCCHL1Encoder(wCN, wTN, wMapping, wParent), 1248 1254 mPreviousFACCH(false),mOffset(0), 1249 1255 mTCHU(189),mTCHD(260), … … 1526 1532 1527 1533 1528 SACCHL1Encoder::SACCHL1Encoder(unsigned w TN, const TDMAMapping& wMapping, SACCHL1FEC *wParent)1529 :XCCHL1Encoder(w TN,wMapping,(L1FEC*)wParent),1534 SACCHL1Encoder::SACCHL1Encoder(unsigned wCN, unsigned wTN, const TDMAMapping& wMapping, SACCHL1FEC *wParent) 1535 :XCCHL1Encoder(wCN,wTN,wMapping,(L1FEC*)wParent), 1530 1536 mSACCHParent(wParent), 1531 1537 mOrderedMSPower(33),mOrderedMSTiming(0) -
openbts/trunk/GSM/GSML1FEC.h
r2324 r3688 93 93 //@{ 94 94 const TDMAMapping& mMapping; ///< multiplexing description 95 unsigned mCN; ///< carrier index 95 96 unsigned mTN; ///< timeslot number to use 96 97 unsigned mTSC; ///< training sequence for this channel … … 120 121 /** 121 122 The basic encoder constructor. 123 @param wCN carrier index. 122 124 @param wTN TDMA timeslot number. 123 125 @param wMapping TDMA mapping onto the timeslot -- MUST PERSIST. 124 126 @param wParent The containing L1FEC, for sibling access -- may be NULL. 125 127 */ 126 L1Encoder(unsigned w TN, const TDMAMapping& wMapping, L1FEC *wParent);128 L1Encoder(unsigned wCN, unsigned wTN, const TDMAMapping& wMapping, L1FEC *wParent); 127 129 128 130 virtual ~L1Encoder() {} … … 140 142 /**@name Components of the channel description. */ 141 143 //@{ 144 unsigned CN() const { return mCN; } 142 145 unsigned TN() const { return mTN; } 143 146 unsigned TSC() const { return mTSC; } … … 232 235 /**@name Parameters fixed by the constructor, not requiring mutex protection. */ 233 236 //@{ 237 unsigned mCN; ///< carrier index 234 238 unsigned mTN; ///< timeslot number 235 239 const TDMAMapping& mMapping; ///< demux parameters … … 248 252 @param wParent The containing L1FEC, for sibling access. 249 253 */ 250 L1Decoder(unsigned w TN, const TDMAMapping& wMapping, L1FEC* wParent)254 L1Decoder(unsigned wCN, unsigned wTN, const TDMAMapping& wMapping, L1FEC* wParent) 251 255 :mUpstream(NULL), 252 256 mT3101(T3101ms),mT3109(T3109ms),mT3111(T3111ms), … … 254 258 mRunning(false), 255 259 mFER(0.0F), 256 m TN(wTN),260 mCN(wCN),mTN(wTN), 257 261 mMapping(wMapping),mParent(wParent) 258 262 { … … 383 387 unsigned TN() const 384 388 { assert(mEncoder); return mEncoder->TN(); } 389 390 unsigned CN() const 391 { assert(mEncoder); return mEncoder->CN(); } 385 392 386 393 unsigned TSC() const … … 459 466 RACHL1Decoder(const TDMAMapping &wMapping, 460 467 L1FEC *wParent) 461 :L1Decoder(0, wMapping,wParent),468 :L1Decoder(0,0,wMapping,wParent), 462 469 mParity(0x06f,6,8),mU(18),mD(mU.head(8)) 463 470 { } … … 501 508 public: 502 509 503 XCCHL1Decoder(unsigned w TN, const TDMAMapping& wMapping,510 XCCHL1Decoder(unsigned wCN, unsigned wTN, const TDMAMapping& wMapping, 504 511 L1FEC *wParent); 505 512 … … 549 556 550 557 SDCCHL1Decoder( 558 unsigned wCN, 551 559 unsigned wTN, 552 560 const TDMAMapping& wMapping, 553 561 L1FEC *wParent) 554 :XCCHL1Decoder(w TN,wMapping,wParent)562 :XCCHL1Decoder(wCN,wTN,wMapping,wParent) 555 563 { } 556 564 … … 580 588 581 589 SACCHL1Decoder( 590 unsigned wCN, 582 591 unsigned wTN, 583 592 const TDMAMapping& wMapping, 584 593 SACCHL1FEC *wParent) 585 :XCCHL1Decoder(w TN,wMapping,(L1FEC*)wParent),594 :XCCHL1Decoder(wCN,wTN,wMapping,(L1FEC*)wParent), 586 595 mSACCHParent(wParent), 587 596 mRSSICounter(0) … … 654 663 655 664 XCCHL1Encoder( 665 unsigned wCN, 656 666 unsigned wTN, 657 667 const TDMAMapping& wMapping, … … 721 731 public: 722 732 723 TCHFACCHL1Encoder(unsigned w TN,733 TCHFACCHL1Encoder(unsigned wCN, unsigned wTN, 724 734 const TDMAMapping& wMapping, 725 735 L1FEC* wParent); … … 781 791 public: 782 792 783 TCHFACCHL1Decoder(unsigned w TN,793 TCHFACCHL1Decoder(unsigned wCN, unsigned wTN, 784 794 const TDMAMapping& wMapping, 785 795 L1FEC *wParent); … … 837 847 838 848 GeneratorL1Encoder( 849 unsigned wCN, 839 850 unsigned wTN, 840 851 const TDMAMapping& wMapping, 841 852 L1FEC* wParent) 842 :L1Encoder(w TN,wMapping,wParent)853 :L1Encoder(wCN,wTN,wMapping,wParent) 843 854 { } 844 855 … … 925 936 926 937 NDCCHL1Encoder( 938 unsigned wCN, 927 939 unsigned wTN, 928 940 const TDMAMapping& wMapping, 929 941 L1FEC *wParent) 930 :XCCHL1Encoder(w TN, wMapping, wParent)942 :XCCHL1Encoder(wCN, wTN, wMapping, wParent) 931 943 { } 932 944 … … 955 967 956 968 BCCHL1Encoder(L1FEC *wParent) 957 :NDCCHL1Encoder(0, gBCCHMapping,wParent)969 :NDCCHL1Encoder(0,0,gBCCHMapping,wParent) 958 970 {} 959 971 … … 984 996 public: 985 997 986 SACCHL1Encoder(unsigned w TN, const TDMAMapping& wMapping, SACCHL1FEC *wParent);998 SACCHL1Encoder(unsigned wCN, unsigned wTN, const TDMAMapping& wMapping, SACCHL1FEC *wParent); 987 999 988 1000 void orderedMSPower(int power) { mOrderedMSPower = power; } … … 1022 1034 CCCHL1Encoder(const TDMAMapping& wMapping, 1023 1035 L1FEC* wParent) 1024 :XCCHL1Encoder(0, wMapping,wParent)1036 :XCCHL1Encoder(0,0,wMapping,wParent) 1025 1037 {} 1026 1038 … … 1028 1040 1029 1041 1042 /** Cell Broadcast Channel (CBCH). */ 1043 class 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 1030 1059 1031 1060 … … 1036 1065 1037 1066 SDCCHL1FEC( 1067 unsigned wCN, 1038 1068 unsigned wTN, 1039 1069 const MappingPair& wMapping) 1040 1070 :L1FEC() 1041 1071 { 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 1082 class CBCHL1FEC : public L1FEC { 1083 1084 public: 1085 1086 CBCHL1FEC(const MappingPair& wMapping) 1087 :L1FEC() 1088 { 1089 mEncoder = new CBCHL1Encoder(wMapping.downlink(),this); 1090 } 1091 }; 1047 1092 1048 1093 … … 1066 1111 1067 1112 TCHFACCHL1FEC( 1113 unsigned wCN, 1068 1114 unsigned wTN, 1069 1115 const MappingPair& wMapping) 1070 1116 :L1FEC() 1071 1117 { 1072 mTCHEncoder = new TCHFACCHL1Encoder(w TN, wMapping.downlink(), this );1118 mTCHEncoder = new TCHFACCHL1Encoder(wCN, wTN, wMapping.downlink(), this ); 1073 1119 mEncoder = mTCHEncoder; 1074 mTCHDecoder = new TCHFACCHL1Decoder(w TN, wMapping.uplink(), this );1120 mTCHDecoder = new TCHFACCHL1Decoder(wCN, wTN, wMapping.uplink(), this ); 1075 1121 mDecoder = mTCHDecoder; 1076 1122 } … … 1108 1154 1109 1155 SACCHL1FEC( 1156 unsigned wCN, 1110 1157 unsigned wTN, 1111 1158 const MappingPair& wMapping) 1112 1159 :L1FEC() 1113 1160 { 1114 mSACCHEncoder = new SACCHL1Encoder(w TN,wMapping.downlink(),this);1161 mSACCHEncoder = new SACCHL1Encoder(wCN,wTN,wMapping.downlink(),this); 1115 1162 mEncoder = mSACCHEncoder; 1116 mSACCHDecoder = new SACCHL1Decoder(w TN,wMapping.uplink(),this);1163 mSACCHDecoder = new SACCHL1Decoder(wCN,wTN,wMapping.uplink(),this); 1117 1164 mDecoder = mSACCHDecoder; 1118 1165 } … … 1143 1190 public: 1144 1191 1145 LoopbackL1FEC(unsigned w TN)1192 LoopbackL1FEC(unsigned wCN, unsigned wTN) 1146 1193 :L1FEC() 1147 1194 { 1148 mEncoder = new XCCHL1Encoder(w TN,gLoopbackTestFullMapping,this);1149 mDecoder = new SDCCHL1Decoder(w TN,gLoopbackTestFullMapping,this);1195 mEncoder = new XCCHL1Encoder(wCN,wTN,gLoopbackTestFullMapping,this); 1196 mDecoder = new SDCCHL1Decoder(wCN,wTN,gLoopbackTestFullMapping,this); 1150 1197 } 1151 1198 }; -
openbts/trunk/GSM/GSMLogicalChannel.cpp
r2242 r3688 164 164 165 165 SDCCHLogicalChannel::SDCCHLogicalChannel( 166 unsigned wCN, 166 167 unsigned wTN, 167 168 const CompleteMapping& wMapping) 168 169 { 169 mL1 = new SDCCHL1FEC(w TN,wMapping.LCH());170 mL1 = new SDCCHL1FEC(wCN,wTN,wMapping.LCH()); 170 171 // SAP0 is RR/MM/CC, SAP3 is SMS 171 172 // SAP1 and SAP2 are not used. … … 176 177 mL2[0] = SAP0L2; 177 178 mL2[3] = SAP3L2; 178 mSACCH = new SACCHLogicalChannel(w TN,wMapping.SACCH());179 mSACCH = new SACCHLogicalChannel(wCN,wTN,wMapping.SACCH()); 179 180 connect(); 180 181 } … … 185 186 186 187 SACCHLogicalChannel::SACCHLogicalChannel( 188 unsigned wCN, 187 189 unsigned wTN, 188 190 const MappingPair& wMapping) 189 191 : mRunning(false) 190 192 { 191 mSACCHL1 = new SACCHL1FEC(w TN,wMapping);193 mSACCHL1 = new SACCHL1FEC(wCN,wTN,wMapping); 192 194 mL1 = mSACCHL1; 193 195 // SAP0 is RR, SAP3 is SMS … … 350 352 351 353 TCHFACCHLogicalChannel::TCHFACCHLogicalChannel( 354 unsigned wCN, 352 355 unsigned wTN, 353 356 const CompleteMapping& wMapping) 354 357 { 355 mTCHL1 = new TCHFACCHL1FEC(w TN,wMapping.LCH());358 mTCHL1 = new TCHFACCHL1FEC(wCN,wTN,wMapping.LCH()); 356 359 mL1 = mTCHL1; 357 360 // SAP0 is RR/MM/CC, SAP3 is SMS … … 359 362 mL2[0] = new FACCHL2(1,0); 360 363 mL2[3] = new FACCHL2(1,3); 361 mSACCH = new SACCHLogicalChannel(w TN,wMapping.SACCH());364 mSACCH = new SACCHLogicalChannel(wCN,wTN,wMapping.SACCH()); 362 365 connect(); 363 366 } -
openbts/trunk/GSM/GSMLogicalChannel.h
r2305 r3688 221 221 //@{ 222 222 /** Carrier index. */ 223 unsigned CN() const { return 0; }223 unsigned CN() const { assert(mL1); return mL1->CN(); } 224 224 /** Slot number. */ 225 225 unsigned TN() const { assert(mL1); return mL1->TN(); } … … 297 297 298 298 SDCCHLogicalChannel( 299 unsigned wCN, 299 300 unsigned wTN, 300 301 const CompleteMapping& wMapping); … … 361 362 362 363 SACCHLogicalChannel( 364 unsigned wCN, 363 365 unsigned wTN, 364 366 const MappingPair& wMapping); … … 467 469 468 470 TCHFACCHLogicalChannel( 471 unsigned wCN, 469 472 unsigned wTN, 470 473 const CompleteMapping& wMapping); … … 532 535 public : 533 536 SDCCHLogicalChannel_LB( 537 unsigned wCN, 534 538 unsigned wTN, 535 539 const CompleteMapping& wMapping); … … 542 546 /** Custom constructor, L2 is Uplink instead of downlink. */ 543 547 TCHFACCHLogicalChannel_UPLINK( 548 unsigned wCN, 544 549 unsigned wTN, 545 550 const CompleteMapping& wMapping); -
openbts/trunk/GSM/PowerManager.cpp
r2242 r3688 125 125 void PowerManager::start() 126 126 { 127 mRadio = gTRX.ARFCN( );127 mRadio = gTRX.ARFCN(0); 128 128 mRadio->setPower(mAtten); 129 129 mThread.start((void*(*)(void*))PowerManagerServiceLoopAdapter,this); -
openbts/trunk/TRXManager/TRXManager.cpp
r2242 r3688 46 46 47 47 48 TransceiverManager::TransceiverManager(const char* wTRXAddress, int wBasePort) 48 TransceiverManager::TransceiverManager(int numARFCNs, 49 const char* wTRXAddress, int wBasePort) 49 50 :mHaveClock(false), 50 51 mClockSocket(wBasePort+100) 51 52 { 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 } 54 58 } 55 59 … … 59 63 { 60 64 mClockThread.start((void*(*)(void*))ClockLoopAdapter,this); 61 mARFCN->start(); 65 for (unsigned i=0; i<mARFCNs.size(); i++) { 66 mARFCNs[i]->start(); 67 } 62 68 } 63 69 -
openbts/trunk/TRXManager/TRXManager.h
r2305 r3688 59 59 private: 60 60 61 /// the ARFCN mananger under this TRX62 ARFCNManager* mARFCN;61 /// the ARFCN manangers under this TRX 62 std::vector<ARFCNManager*> mARFCNs; 63 63 64 64 /// set true when the first CLOCK packet is received … … 74 74 /** 75 75 Construct a TransceiverManager. 76 @param numARFCNs Number of ARFCNs supported by the transceiver. 76 77 @param wTRXAddress IP address of the transceiver. 77 78 @param wBasePort The base port for the interface, as defined in README.TRX. 78 79 */ 79 TransceiverManager(const char* wTRXAddress, int wBasePort); 80 TransceiverManager(int numARFCNs, 81 const char* wTRXAddress, int wBasePort); 80 82 81 83 /**@name Accessors. */ 82 84 //@{ 83 ARFCNManager* ARFCN( ) { return mARFCN; }85 ARFCNManager* ARFCN(unsigned i) { assert(i<mARFCNs.size()); return mARFCNs.at(i); } 84 86 //@} 87 88 unsigned numARFCNs() const { return mARFCNs.size(); } 89 90 /** Block until the clock is set over the UDP link. */ 91 //void waitForClockInit() const; 85 92 86 93 /** Start the clock management thread and all ARFCN managers. */ -
openbts/trunk/apps/OpenBTS.cpp
r3165 r3688 92 92 93 93 // Our interface to the software-defined radio. 94 TransceiverManager gTRX(gConfig.get Str("TRX.IP").c_str(), gConfig.getNum("TRX.Port"));94 TransceiverManager gTRX(gConfig.getNum("GSM.Radio.ARFCNs"), gConfig.getStr("TRX.IP").c_str(), gConfig.getNum("TRX.Port")); 95 95 96 96 // Subscriber registry … … 117 117 // If the path is not defined, the transceiver must be started by some other process. 118 118 char TRXnumARFCN[4]; 119 sprintf(TRXnumARFCN,"%1d", 1);119 sprintf(TRXnumARFCN,"%1d",gConfig.getNum("GSM.Radio.ARFCNs")); 120 120 LOG(NOTICE) << "starting transceiver " << transceiverPath << " " << TRXnumARFCN; 121 121 gTransceiverPid = vfork(); … … 176 176 // Set up the interface to the radio. 177 177 // Get a handle to the C0 transceiver interface. 178 ARFCNManager* C0radio = gTRX.ARFCN( );178 ARFCNManager* C0radio = gTRX.ARFCN(0); 179 179 180 180 // Tuning. … … 183 183 // Get the ARFCN list. 184 184 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 } 189 193 190 194 // Set TSC same as BCC everywhere. … … 240 244 // C-V C0T0 SDCCHs 241 245 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), 246 250 }; 247 251 Thread C0T0SDCCHControlThread[4]; … … 264 268 // Create C-I slots. 265 269 for (int i=0; i<gConfig.getNum("GSM.Channels.NumC1s"); i++) { 266 gBTS.createCombinationI(gTRX,sCount );270 gBTS.createCombinationI(gTRX,sCount/8,sCount%8); 267 271 sCount++; 268 272 } … … 271 275 // Create C-VII slots. 272 276 for (int i=0; i<gConfig.getNum("GSM.Channels.NumC7s"); i++) { 273 gBTS.createCombinationVII(gTRX,sCount );277 gBTS.createCombinationVII(gTRX,sCount/8,sCount%8); 274 278 sCount++; 275 279 } … … 278 282 // Create C-I slots. 279 283 for (int i=0; i<gConfig.getNum("GSM.Channels.NumC1s"); i++) { 280 gBTS.createCombinationI(gTRX,sCount );284 gBTS.createCombinationI(gTRX,sCount/8,sCount%8); 281 285 sCount++; 282 286 }
![(please configure the [header_logo] section in trac.ini)](http://wush.net/trac/rangepublic/raw-attachment/wiki/WikiStart/PublicReleaseLogo.png)
