Throw exception if usrp is not found. Don't crash transceiver.
This commit is contained in:
parent
f3fbf2a39e
commit
23d826d3ba
|
@ -33,6 +33,7 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <stdexcept>
|
||||||
#include "Threads.h"
|
#include "Threads.h"
|
||||||
#include "USRPDevice.h"
|
#include "USRPDevice.h"
|
||||||
|
|
||||||
|
@ -179,6 +180,8 @@ bool USRPDevice::make(bool wSkipRx)
|
||||||
m_uRx = usrp_standard_rx_sptr(usrp_standard_rx::make(0,decimRate,1,-1,
|
m_uRx = usrp_standard_rx_sptr(usrp_standard_rx::make(0,decimRate,1,-1,
|
||||||
usrp_standard_rx::FPGA_MODE_NORMAL,
|
usrp_standard_rx::FPGA_MODE_NORMAL,
|
||||||
1024,16*8,rbf));
|
1024,16*8,rbf));
|
||||||
|
if (!m_uRx) throw runtime_error("");
|
||||||
|
|
||||||
#ifdef HAVE_LIBUSRP_3_2
|
#ifdef HAVE_LIBUSRP_3_2
|
||||||
m_uRx->set_fpga_master_clock_freq(masterClockRate);
|
m_uRx->set_fpga_master_clock_freq(masterClockRate);
|
||||||
#endif
|
#endif
|
||||||
|
@ -202,6 +205,7 @@ bool USRPDevice::make(bool wSkipRx)
|
||||||
try {
|
try {
|
||||||
m_uTx = usrp_standard_tx_sptr(usrp_standard_tx::make(0,decimRate*2,1,-1,
|
m_uTx = usrp_standard_tx_sptr(usrp_standard_tx::make(0,decimRate*2,1,-1,
|
||||||
1024,16*8,rbf));
|
1024,16*8,rbf));
|
||||||
|
if (!m_uTx) throw runtime_error("");
|
||||||
#ifdef HAVE_LIBUSRP_3_2
|
#ifdef HAVE_LIBUSRP_3_2
|
||||||
m_uTx->set_fpga_master_clock_freq(masterClockRate);
|
m_uTx->set_fpga_master_clock_freq(masterClockRate);
|
||||||
#endif
|
#endif
|
||||||
|
|
Reference in New Issue