-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBladeRfDeviceController.hpp
More file actions
executable file
·77 lines (57 loc) · 1.96 KB
/
BladeRfDeviceController.hpp
File metadata and controls
executable file
·77 lines (57 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#pragma once
#include <QObject>
#include <libbladeRF.h>
#include "Types/MissionConfig.hpp"
#define BladeRFUndefined -1
#ifndef MIXING_SIGNAL
#define MIXING_SIGNAL true
#define MIXING_SIGNAL_SINGLE MIXING_SIGNAL and true
#define MIXING_SIGNAL_STREAM MIXING_SIGNAL and false
#if MIXING_SIGNAL_STREAM
#define MIXING_SIGNAL_TEST false
#define MIXING_SIGNAL_ADVANCED false
#endif
#endif
class BladeRfStream;
class RawData;
class BladeRfDeviceController : public QObject
{
Q_OBJECT
signals:
void opened();
void closed();
void errorOccured();
void sessionStarted();
void sessionStopped();
void rxDataAvailable(const RawData& data);
public:
explicit BladeRfDeviceController(QObject* parent = nullptr);
~BladeRfDeviceController();
void enableClockBroadcast();
void enableClockListening();
void setReferenceClock();
bool triggerFire();
void printAboutDevice();
public slots:
void deviceOpen(const bladerf_devinfo deviceInfo);
void deviceClose();
void sessionStart(const MissionConfig& config);
void sessionStop();
private:
bool error(const QString& message, int bladerf_error = 0, bladerf_channel module = BladeRFUndefined);
void log(const QString& message, bladerf_channel module = BladeRFUndefined) const;
QString moduleToString(bladerf_channel module) const;
bool moduleSetup(bladerf_direction direction, bladerf_module module);
bool moduleState(bladerf_module module, bool state);
bool moduleGain(bladerf_module module, int value);
void deviceSilentReopen();
private slots:
void onRxCaptureAvailable(qint16* buffer, unsigned short samplesCount);
private:
MissionConfig mSessionConfig;
bladerf_devinfo mDeviceInfo;
bladerf* mDeviceHandle = nullptr;
std::atomic_bool mCaptureProcessFlag;
BladeRfStream* mRxStream = nullptr;
BladeRfStream* mTxStream = nullptr;
};