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.
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
DevicePerseus Class Reference

#include <deviceperseus.h>

+ Collaboration diagram for DevicePerseus:

Public Member Functions

void scan ()
 
void getSerials (std::vector< std::string > &serials) const
 
int getSequenceFromSerial (const std::string &serial) const
 

Static Public Member Functions

static DevicePerseusinstance ()
 

Protected Member Functions

 DevicePerseus ()
 
 DevicePerseus (const DevicePerseus &)
 
DevicePerseusoperator= (const DevicePerseus &other)
 
 ~DevicePerseus ()
 

Private Member Functions

bool internal_scan ()
 

Private Attributes

int m_nbDevices
 
DevicePerseusScan m_scan
 

Detailed Description

Definition at line 25 of file deviceperseus.h.

Constructor & Destructor Documentation

◆ DevicePerseus() [1/2]

DevicePerseus::DevicePerseus ( )
protected

Definition at line 21 of file deviceperseus.cpp.

References m_nbDevices.

22 {
23  m_nbDevices = perseus_init();
24 }

◆ DevicePerseus() [2/2]

DevicePerseus::DevicePerseus ( const DevicePerseus )
inlineprotected

Definition at line 35 of file deviceperseus.h.

35 : m_nbDevices(0) {}

◆ ~DevicePerseus()

DevicePerseus::~DevicePerseus ( )
protected

Definition at line 26 of file deviceperseus.cpp.

27 {
28  perseus_exit();
29 }

Member Function Documentation

◆ getSequenceFromSerial()

int DevicePerseus::getSequenceFromSerial ( const std::string &  serial) const
inline

Definition at line 31 of file deviceperseus.h.

Referenced by PerseusInput::openDevice().

31 { return m_scan.getSequenceFromSerial(serial); }
DevicePerseusScan m_scan
Definition: deviceperseus.h:42
int getSequenceFromSerial(const std::string &serial) const
+ Here is the caller graph for this function:

◆ getSerials()

void DevicePerseus::getSerials ( std::vector< std::string > &  serials) const
inline

Definition at line 30 of file deviceperseus.h.

Referenced by PerseusPlugin::enumSampleSources().

30 { m_scan.getSerials(serials); }
void getSerials(std::vector< std::string > &serials) const
DevicePerseusScan m_scan
Definition: deviceperseus.h:42
+ Here is the caller graph for this function:

◆ instance()

DevicePerseus & DevicePerseus::instance ( )
static

Definition at line 31 of file deviceperseus.cpp.

Referenced by PerseusPlugin::enumSampleSources(), and PerseusInput::openDevice().

32 {
33  static DevicePerseus inst;
34  return inst;
35 }
+ Here is the caller graph for this function:

◆ internal_scan()

bool DevicePerseus::internal_scan ( )
private

Definition at line 51 of file deviceperseus.cpp.

References m_nbDevices, m_scan, and DevicePerseusScan::scan().

Referenced by scan().

52 {
53  return m_scan.scan(m_nbDevices);
54 }
bool scan(int nbDevices)
false if one device had its firmware not yet downloaded
DevicePerseusScan m_scan
Definition: deviceperseus.h:42
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

DevicePerseus& DevicePerseus::operator= ( const DevicePerseus other)
inlineprotected

Definition at line 36 of file deviceperseus.h.

36 { (void) other; return *this; }

◆ scan()

void DevicePerseus::scan ( )

Definition at line 37 of file deviceperseus.cpp.

References DevicePerseusScan::clear(), internal_scan(), m_nbDevices, and m_scan.

Referenced by PerseusPlugin::enumSampleSources().

38 {
39  // If some firmware was not downloaded at time of enumeration interface will break later
40  // so in this case we re initialize the library, clear the scan results and scan again
41  if (!internal_scan())
42  {
43  qDebug("DevicePerseus::scan: re-init library and scan again");
44  m_scan.clear();
45  perseus_exit();
46  m_nbDevices = perseus_init();
47  internal_scan();
48  }
49 }
DevicePerseusScan m_scan
Definition: deviceperseus.h:42
bool internal_scan()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_nbDevices

int DevicePerseus::m_nbDevices
private

Definition at line 41 of file deviceperseus.h.

Referenced by DevicePerseus(), internal_scan(), and scan().

◆ m_scan

DevicePerseusScan DevicePerseus::m_scan
private

Definition at line 42 of file deviceperseus.h.

Referenced by internal_scan(), and scan().


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