31 qCritical(
"DeviceBladeRF::open_bladerf: could not open BladeRF");
35 fpga_loaded = bladerf_is_fpga_configured(*dev);
39 qCritical(
"DeviceBladeRF::open_bladerf: failed to check FPGA state: %s",
40 bladerf_strerror(fpga_loaded));
43 else if (fpga_loaded == 0)
45 qCritical(
"BladerfOutput::start: the device's FPGA is not loaded.");
56 struct bladerf_devinfo info;
62 bladerf_init_devinfo(&info);
68 strncpy(info.serial, serial, BLADERF_SERIAL_LENGTH - 1);
69 info.serial[BLADERF_SERIAL_LENGTH - 1] =
'\0';
72 status = bladerf_open_with_devinfo(&dev, &info);
74 if (status == BLADERF_ERR_NODEV)
76 qCritical(
"DeviceBladeRF::open_bladerf_from_serial: No devices available with serial %s", serial);
81 qCritical(
"DeviceBladeRF::open_bladerf_from_serial: Failed to open device with serial %s (%s)",
82 serial, bladerf_strerror(status));
112 if (bandwidth_index < m_nb_halfbw)
114 return m_halfbw[bandwidth_index] * 2;
118 return m_halfbw[0] * 2;
124 for (
unsigned int i=0;
i < m_nb_halfbw;
i++)
126 if (bandwidth/2000 == m_halfbw[
i])
static bool open_bladerf(struct bladerf **dev, const char *serial)
static struct bladerf * open_bladerf_from_serial(const char *serial)
static unsigned int getBandwidth(unsigned int bandwidth_index)
static const unsigned int m_nb_halfbw
static unsigned int getNbBandwidths()
static unsigned int getBandwidthIndex(unsigned int bandwidth)
static const unsigned int m_halfbw[]