1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-08-14 15:33:34 -04:00

HackRF: use DeviceHackRF as a singleton to handle HackRF library init and exit only once

This commit is contained in:
f4exb
2017-09-01 00:46:43 +02:00
parent afe08a3547
commit ec3a99451c
4 changed files with 50 additions and 38 deletions
+6
View File
@@ -22,8 +22,14 @@
class DeviceHackRF
{
public:
static DeviceHackRF& instance();
static hackrf_device *open_hackrf(int sequence);
static hackrf_device *open_hackrf(const char * const serial);
protected:
DeviceHackRF();
DeviceHackRF(const DeviceHackRF&) {}
DeviceHackRF& operator=(const DeviceHackRF& other __attribute__((unused))) { return *this; }
~DeviceHackRF();
private:
static hackrf_device *open_hackrf_from_sequence(int sequence);
};