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.
deviceplutosdrshared.h
Go to the documentation of this file.
1 // Copyright (C) 2017 Edouard Griffiths, F4EXB //
3 // //
4 // This program is free software; you can redistribute it and/or modify //
5 // it under the terms of the GNU General Public License as published by //
6 // the Free Software Foundation as version 3 of the License, or //
7 // (at your option) any later version. //
8 // //
9 // This program is distributed in the hope that it will be useful, //
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12 // GNU General Public License V3 for more details. //
13 // //
14 // You should have received a copy of the GNU General Public License //
15 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
17 
18 #ifndef DEVICES_PLUTOSDR_DEVICEPLUTOSDRSHARED_H_
19 #define DEVICES_PLUTOSDR_DEVICEPLUTOSDRSHARED_H_
20 
21 #include <stdint.h>
22 
23 #include "util/message.h"
24 #include "export.h"
25 
27 
32 {
33 public:
38  {
39  public:
40  virtual void startWork() = 0;
41  virtual void stopWork() = 0;
42  virtual void setDeviceSampleRate(int sampleRate) = 0;
43  virtual bool isRunning() = 0;
44  };
45 
48  public:
49  uint64_t getDevSampleRate() const { return m_devSampleRate; }
50  uint32_t getLpfFirbw() const { return m_lpfFIRBW; }
51  bool isLpfFirEnable() const { return m_lpfFIREnable; }
52  uint32_t getLpfFiRlog2IntDec() const { return m_lpfFIRlogIntDec; }
53  int32_t getLoPPMTenths() const { return m_loPPMTenths; }
54 
55  static MsgCrossReportToBuddy *create(uint64_t devSampleRate,
56  bool lpfFIREnable,
57  uint32_t lpfFIRlog2Interp,
58  uint32_t lpfFIRBW,
59  int32_t loPPMTenths)
60  {
61  return new MsgCrossReportToBuddy(devSampleRate,
62  lpfFIREnable,
63  lpfFIRlog2Interp,
64  lpfFIRBW,
65  loPPMTenths);
66  }
67 
68  private:
70  bool lpfFIREnable,
71  uint32_t lpfFIRlog2IntDec,
72  uint32_t lpfFIRBW,
73  int32_t loPPMTenths) :
74  Message(),
75  m_devSampleRate(devSampleRate),
76  m_lpfFIREnable(lpfFIREnable),
77  m_lpfFIRlogIntDec(lpfFIRlog2IntDec),
78  m_lpfFIRBW(lpfFIRBW),
79  m_loPPMTenths(loPPMTenths)
80  { }
81 
87  };
88 
92 
93  static const float m_sampleFifoLengthInSeconds;
94  static const int m_sampleFifoMinSize;
95 
97  m_deviceParams(0),
98  m_thread(0),
99  m_threadWasRunning(false)
100  {}
101 
103  {}
104 };
105 
106 
107 #endif /* DEVICES_PLUTOSDR_DEVICEPLUTOSDRSHARED_H_ */
bool m_threadWasRunning
flag to know if thread needs to be resumed after suspend
ThreadInterface * m_thread
holds the thread address if started else 0
MsgCrossReportToBuddy(uint64_t devSampleRate, bool lpfFIREnable, uint32_t lpfFIRlog2IntDec, uint32_t lpfFIRBW, int32_t loPPMTenths)
DevicePlutoSDRParams * m_deviceParams
unique hardware device parameters
#define DEVICES_API
Definition: export.h:76
static MsgCrossReportToBuddy * create(uint64_t devSampleRate, bool lpfFIREnable, uint32_t lpfFIRlog2Interp, uint32_t lpfFIRBW, int32_t loPPMTenths)
unsigned int uint32_t
Definition: rtptypes_win.h:46
static const int m_sampleFifoMinSize
#define MESSAGE_CLASS_DECLARATION
Definition: message.h:43
int int32_t
Definition: rtptypes_win.h:45
static const float m_sampleFifoLengthInSeconds
unsigned __int64 uint64_t
Definition: rtptypes_win.h:48