laforge
/
openbts-osmo
Archived
1
0
Fork 0

uhd: exit on device open failure

If the device doesn't open, there's no reason to continue. Shut down
so the process doesn't linger.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
This commit is contained in:
Thomas Tsou 2010-11-16 15:53:25 -05:00
parent 9c091dc7a9
commit ce33adf422
2 changed files with 9 additions and 2 deletions

View File

@ -42,7 +42,10 @@ int main(int argc, char *argv[]) {
if (argc>2) gSetLogFile(argv[2]);
Device *usrp = Device::make(400e3);
usrp->open();
if (!usrp->open()) {
cerr << "Device open failed. Exiting..." << endl;
exit(1);
}
TIMESTAMP timestamp;

View File

@ -50,7 +50,11 @@ int main(int argc, char *argv[]) {
srandom(time(NULL));
Device *usrp = Device::make(400.0e3);
usrp->open();
if (!usrp->open()) {
cerr << "Device open failed. Exiting..." << endl;
exit(1);
}
RadioInterface* radio = new RadioInterface(usrp,3);
Transceiver *trx = new Transceiver(5700,"127.0.0.1",SAMPSPERSYM,GSM::Time(2,0),radio);
trx->transmitFIFO(radio->transmitFIFO());