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 4e59d6630b
commit 67e3d5ad87
1 changed files with 11 additions and 5 deletions

View File

@ -26,7 +26,7 @@
#include "Transceiver.h"
#include "USRPDevice.h"
#include "radioDevice.h"
#include "DummyLoad.h"
#include <time.h>
@ -36,6 +36,12 @@
#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");
@ -72,10 +78,10 @@ int main(int argc, char *argv[])
srandom(time(NULL));
int mOversamplingRate = numARFCN/2 + numARFCN;
//DYNDevice *usrp = new DYNDevice(mOversamplingRate*1625.0e3/6.0);
USRPDevice *usrp = new USRPDevice(mOversamplingRate*1625.0e3/6.0);
//DummyLoad *usrp = new DummyLoad(mOversamplingRate*1625.0e3/6.0);
usrp->make();
RadioDevice *usrp = RadioDevice::make(DEVICERATE);
if (!usrp->open()) {
return EXIT_FAILURE;
}
RadioInterface* radio = new RadioInterface(usrp,3,SAMPSPERSYM,mOversamplingRate,false);
Transceiver *trx = new Transceiver(5700,"127.0.0.1",SAMPSPERSYM,GSM::Time(2,0),radio);