MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / main

Function main

TransceiverRAD1/runTransceiver.cpp:46–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45
46int main(int argc, char *argv[])
47{
48 if ( signal( SIGINT, ctrlCHandler ) == SIG_ERR )
49 {
50 cerr << "Couldn't install signal handler for SIGINT" << endl;
51 exit(1);
52 }
53
54 if ( signal( SIGTERM, ctrlCHandler ) == SIG_ERR )
55 {
56 cerr << "Couldn't install signal handler for SIGTERM" << endl;
57 exit(1);
58 }
59 // Configure logger.
60 gLogInit("transceiver",gConfig.getStr("Log.Level").c_str(),LOG_LOCAL7);
61
62 int numARFCN=1;
63 if (argc>1) numARFCN = atoi(argv[1]);
64
65 int deviceID = 0;
66 if (argc>2) deviceID = atoi(argv[2]);
67
68 gFactoryCalibration.readEEPROM(deviceID);
69
70
71 srandom(time(NULL));
72
73 int mOversamplingRate = 1;
74 switch(numARFCN) {
75
76 case 1:
77 mOversamplingRate = 1;
78 break;
79 case 2:
80 mOversamplingRate = 6;
81 break;
82 case 3:
83 mOversamplingRate = 8;
84 break;
85 case 4:
86 mOversamplingRate = 12;
87 break;
88 case 5:
89 mOversamplingRate = 16;
90 break;
91 default:
92 break;
93 }
94 //int mOversamplingRate = numARFCN/2 + numARFCN;
95 //mOversamplingRate = 15; //mOversamplingRate*2;
96 //if ((numARFCN > 1) && (mOversamplingRate % 2)) mOversamplingRate++;
97 RAD1Device *usrp = new RAD1Device(mOversamplingRate*1625.0e3/6.0);
98 //DummyLoad *usrp = new DummyLoad(mOversamplingRate*1625.0e3/6.0);
99 usrp->make(false, deviceID);
100
101 RadioInterface* radio = new RadioInterface(usrp,3,SAMPSPERSYM,mOversamplingRate,false,numARFCN);
102 Transceiver *trx = new Transceiver(gConfig.getNum("TRX.Port"),gConfig.getStr("TRX.IP").c_str(),SAMPSPERSYM,GSM::Time(2,0),radio,
103 numARFCN,mOversamplingRate,false);

Callers

nothing calls this directly

Calls 5

readEEPROMMethod · 0.80
TimeClass · 0.50
makeMethod · 0.45
receiveFIFOMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected