diff options
Diffstat (limited to 'Transceiver52M/runTransceiver.cpp')
-rw-r--r-- | Transceiver52M/runTransceiver.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/Transceiver52M/runTransceiver.cpp b/Transceiver52M/runTransceiver.cpp index db33251..952cf3b 100644 --- a/Transceiver52M/runTransceiver.cpp +++ b/Transceiver52M/runTransceiver.cpp @@ -36,12 +36,6 @@ #include <Logger.h> #include <Configuration.h> -#ifdef RESAMPLE - #define DEVICERATE 400e3 -#else - #define DEVICERATE 1625e3/6 -#endif - using namespace std; ConfigurationTable gConfig("/etc/OpenBTS/OpenBTS.db"); @@ -88,13 +82,26 @@ int main(int argc, char *argv[]) srandom(time(NULL)); - RadioDevice *usrp = RadioDevice::make(DEVICERATE * SAMPSPERSYM, SAMPSPERSYM); - if (!usrp->open(deviceArgs)) { + RadioDevice *usrp = RadioDevice::make(SAMPSPERSYM); + int radioType = usrp->open(deviceArgs); + if (radioType < 0) { LOG(ALERT) << "Transceiver exiting..." << std::endl; return EXIT_FAILURE; } - RadioInterface* radio = new RadioInterface(usrp,3,SAMPSPERSYM,false); + RadioInterface* radio; + switch (radioType) { + case RadioDevice::NORMAL: + radio = new RadioInterface(usrp, 3, SAMPSPERSYM, false); + break; + case RadioDevice::RESAMP: + radio = new RadioInterfaceResamp(usrp, 3, SAMPSPERSYM, false); + break; + default: + LOG(ALERT) << "Unsupported configuration"; + return EXIT_FAILURE; + } + Transceiver *trx = new Transceiver(gConfig.getNum("TRX.Port"),gConfig.getStr("TRX.IP").c_str(),SAMPSPERSYM,GSM::Time(3,0),radio); trx->receiveFIFO(radio->receiveFIFO()); /* |