SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Static Public Member Functions | Static Private Member Functions | List of all members
DeviceBladeRF1 Class Reference

#include <devicebladerf1.h>

Static Public Member Functions

static bool open_bladerf (struct bladerf **dev, const char *serial)
 

Static Private Member Functions

static struct bladerf * open_bladerf_from_serial (const char *serial)
 

Detailed Description

Definition at line 25 of file devicebladerf1.h.

Member Function Documentation

◆ open_bladerf()

bool DeviceBladeRF1::open_bladerf ( struct bladerf **  dev,
const char *  serial 
)
static

Definition at line 25 of file devicebladerf1.cpp.

References open_bladerf_from_serial().

Referenced by Bladerf1Output::openDevice(), and Bladerf1Input::openDevice().

26 {
27  int fpga_loaded;
28 
29  if ((*dev = open_bladerf_from_serial(serial)) == 0)
30  {
31  qCritical("DeviceBladeRF::open_bladerf: could not open BladeRF");
32  return false;
33  }
34 
35  fpga_loaded = bladerf_is_fpga_configured(*dev);
36 
37  if (fpga_loaded < 0)
38  {
39  qCritical("DeviceBladeRF::open_bladerf: failed to check FPGA state: %s",
40  bladerf_strerror(fpga_loaded));
41  return false;
42  }
43  else if (fpga_loaded == 0)
44  {
45  qCritical("BladerfOutput::start: the device's FPGA is not loaded.");
46  return false;
47  }
48 
49  return true;
50 }
static struct bladerf * open_bladerf_from_serial(const char *serial)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ open_bladerf_from_serial()

struct bladerf * DeviceBladeRF1::open_bladerf_from_serial ( const char *  serial)
staticprivate

Definition at line 52 of file devicebladerf1.cpp.

References BladerfBandwidths::m_halfbw, and BladerfBandwidths::m_nb_halfbw.

Referenced by open_bladerf().

53 {
54  int status;
55  struct bladerf *dev;
56  struct bladerf_devinfo info;
57 
58  /* Initialize all fields to "don't care" wildcard values.
59  *
60  * Immediately passing this to bladerf_open_with_devinfo() would cause
61  * libbladeRF to open any device on any available backend. */
62  bladerf_init_devinfo(&info);
63 
64  /* Specify the desired device's serial number, while leaving all other
65  * fields in the info structure wildcard values */
66  if (serial != 0)
67  {
68  strncpy(info.serial, serial, BLADERF_SERIAL_LENGTH - 1);
69  info.serial[BLADERF_SERIAL_LENGTH - 1] = '\0';
70  }
71 
72  status = bladerf_open_with_devinfo(&dev, &info);
73 
74  if (status == BLADERF_ERR_NODEV)
75  {
76  qCritical("DeviceBladeRF::open_bladerf_from_serial: No devices available with serial %s", serial);
77  return 0;
78  }
79  else if (status != 0)
80  {
81  qCritical("DeviceBladeRF::open_bladerf_from_serial: Failed to open device with serial %s (%s)",
82  serial, bladerf_strerror(status));
83  return 0;
84  }
85  else
86  {
87  return dev;
88  }
89 }
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: