transceiver: update main to non-device specific interface

The low-level RadioDevice interface is agnostic to libusrp
or uhd based devices. 'make' allocates and returns a
pointer to a generic RadioDevice implemented for whatever
class of device determined at compile time.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2684 19bc5d8c-e614-43d4-8b26-e1612bc8e597
This commit is contained in:
Kurtis Heimerl
2011-11-26 03:19:13 +00:00
parent c639bffd06
commit 265034e182

View File

@@ -26,7 +26,7 @@
#include "Transceiver.h" #include "Transceiver.h"
#include "USRPDevice.h" #include "radioDevice.h"
#include "DummyLoad.h" #include "DummyLoad.h"
#include <time.h> #include <time.h>
@@ -36,6 +36,12 @@
#include <Logger.h> #include <Logger.h>
#include <Configuration.h> #include <Configuration.h>
#ifdef RESAMPLE
#define DEVICERATE 400e3
#else
#define DEVICERATE 1625e3/6
#endif
using namespace std; using namespace std;
ConfigurationTable gConfig("/etc/OpenBTS/OpenBTS.db"); ConfigurationTable gConfig("/etc/OpenBTS/OpenBTS.db");
@@ -72,10 +78,10 @@ int main(int argc, char *argv[])
srandom(time(NULL)); srandom(time(NULL));
int mOversamplingRate = numARFCN/2 + numARFCN; int mOversamplingRate = numARFCN/2 + numARFCN;
//DYNDevice *usrp = new DYNDevice(mOversamplingRate*1625.0e3/6.0); RadioDevice *usrp = RadioDevice::make(DEVICERATE);
USRPDevice *usrp = new USRPDevice(mOversamplingRate*1625.0e3/6.0); if (!usrp->open()) {
//DummyLoad *usrp = new DummyLoad(mOversamplingRate*1625.0e3/6.0); return EXIT_FAILURE;
usrp->make(); }
RadioInterface* radio = new RadioInterface(usrp,3,SAMPSPERSYM,mOversamplingRate,false); RadioInterface* radio = new RadioInterface(usrp,3,SAMPSPERSYM,mOversamplingRate,false);
Transceiver *trx = new Transceiver(5700,"127.0.0.1",SAMPSPERSYM,GSM::Time(2,0),radio); Transceiver *trx = new Transceiver(5700,"127.0.0.1",SAMPSPERSYM,GSM::Time(2,0),radio);