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:
parent
9c091dc7a9
commit
ce33adf422
|
@ -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;
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
Reference in New Issue