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.
devicextrxshared.h
Go to the documentation of this file.
1 // Copyright (C) 2017 Sergey Kostanbaev, Fairwaves Inc. //
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_LIMESDR_DEVICELIMESDRSHARED_H_
19 #define DEVICES_LIMESDR_DEVICELIMESDRSHARED_H_
20 
21 #include <cstddef>
22 #include "devicextrxparam.h"
23 #include "util/message.h"
24 
25 class DeviceXTRX;
26 class XTRXInput;
27 class XTRXOutput;
28 
33 {
34 public:
35  class MsgReportBuddyChange : public Message {
37 
38  public:
39  int getDevSampleRate() const { return m_devSampleRate; }
40  unsigned getLog2HardDecimInterp() const { return m_log2HardDecimInterp; }
42  bool getRxElseTx() const { return m_rxElseTx; }
43 
45  int devSampleRate,
46  unsigned log2HardDecimInterp,
47  uint64_t centerFrequency,
48  bool rxElseTx)
49  {
50  return new MsgReportBuddyChange(
51  devSampleRate,
52  log2HardDecimInterp,
53  centerFrequency,
54  rxElseTx);
55  }
56 
57  private:
61  bool m_rxElseTx;
62 
64  int devSampleRate,
65  unsigned log2HardDecimInterp,
66  uint64_t centerFrequency,
67  bool rxElseTx) :
68  Message(),
69  m_devSampleRate(devSampleRate),
70  m_log2HardDecimInterp(log2HardDecimInterp),
71  m_centerFrequency(centerFrequency),
72  m_rxElseTx(rxElseTx)
73  { }
74  };
75 
78 
79  public:
80  bool getExtClock() const { return m_extClock; }
81  uint32_t getExtClockFeq() const { return m_extClockFreq; }
82 
84  bool extClock,
85  uint32_t m_extClockFreq)
86  {
87  return new MsgReportClockSourceChange(
88  extClock,
89  m_extClockFreq);
90  }
91 
92  private:
93  bool m_extClock;
95 
97  bool extClock,
98  uint32_t m_extClockFreq) :
99  Message(),
100  m_extClock(extClock),
101  m_extClockFreq(m_extClockFreq)
102  { }
103  };
104 
105  class MsgReportDeviceInfo : public Message {
107 
108  public:
109  float getTemperature() const { return m_temperature; }
110  bool getGPSLocked() const { return m_gpsLocked; }
111 
112  static MsgReportDeviceInfo* create(float temperature, bool gpsLocked)
113  {
114  return new MsgReportDeviceInfo(temperature, gpsLocked);
115  }
116 
117  private:
120 
121  MsgReportDeviceInfo(float temperature, bool gpsLocked) :
122  Message(),
123  m_temperature(temperature),
124  m_gpsLocked(gpsLocked)
125  { }
126  };
127 
129  {
130  public:
131  virtual void startWork() = 0;
132  virtual void stopWork() = 0;
133  virtual bool isRunning() = 0;
134  };
135 
137  int m_channel;
140 
143 
144  static const float m_sampleFifoLengthInSeconds;
145  static const int m_sampleFifoMinSize;
146 
149 
150  double get_board_temperature();
151  bool get_gps_status();
152 
153 private:
157 };
158 
159 #endif /* DEVICES_LIMESDR_DEVICELIMESDRSHARED_H_ */
XTRXOutput * m_sink
static MsgReportClockSourceChange * create(bool extClock, uint32_t m_extClockFreq)
XTRXInput * m_source
int m_devSampleRate
device/host sample rate
unsigned int uint32_t
Definition: rtptypes_win.h:46
MsgReportClockSourceChange(bool extClock, uint32_t m_extClockFreq)
bool m_threadWasRunning
flag to know if thread needs to be resumed after suspend
bool m_rxElseTx
tells which side initiated the message
MsgReportBuddyChange(int devSampleRate, unsigned log2HardDecimInterp, uint64_t centerFrequency, bool rxElseTx)
#define MESSAGE_CLASS_DECLARATION
Definition: message.h:43
static const int m_sampleFifoMinSize
double get_board_temperature()
uint64_t m_last_1pps_count
DeviceXTRX * m_dev
MsgReportDeviceInfo(float temperature, bool gpsLocked)
uint64_t m_centerFrequency
Center frequency.
int m_channel
allocated channel (-1 if none)
bool m_extClock
True if external clock source.
static MsgReportBuddyChange * create(int devSampleRate, unsigned log2HardDecimInterp, uint64_t centerFrequency, bool rxElseTx)
uint32_t m_extClockFreq
Frequency (Hz) of external clock source.
uint32_t m_no_1pps_count_change_counter
ThreadInterface * m_thread
holds the thread address if started else 0
unsigned m_log2HardDecimInterp
log2 of hardware decimation or interpolation
static MsgReportDeviceInfo * create(float temperature, bool gpsLocked)
static const float m_sampleFifoLengthInSeconds
unsigned __int64 uint64_t
Definition: rtptypes_win.h:48