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

#include <devicextrxshared.h>

+ Collaboration diagram for DeviceXTRXShared:

Classes

class  MsgReportBuddyChange
 
class  MsgReportClockSourceChange
 
class  MsgReportDeviceInfo
 
class  ThreadInterface
 

Public Member Functions

 DeviceXTRXShared ()
 
 ~DeviceXTRXShared ()
 
double get_board_temperature ()
 
bool get_gps_status ()
 

Public Attributes

DeviceXTRXm_dev
 
int m_channel
 allocated channel (-1 if none) More...
 
XTRXInputm_source
 
XTRXOutputm_sink
 
ThreadInterfacem_thread
 holds the thread address if started else 0 More...
 
bool m_threadWasRunning
 flag to know if thread needs to be resumed after suspend More...
 

Static Public Attributes

static const float m_sampleFifoLengthInSeconds = 0.25
 
static const int m_sampleFifoMinSize = 48000
 

Private Attributes

bool m_first_1pps_count
 
uint64_t m_last_1pps_count
 
uint32_t m_no_1pps_count_change_counter
 

Detailed Description

Structure shared by a buddy with other buddies

Definition at line 32 of file devicextrxshared.h.

Constructor & Destructor Documentation

◆ DeviceXTRXShared()

DeviceXTRXShared::DeviceXTRXShared ( )

Definition at line 30 of file devicextrxshared.cpp.

30  :
31  m_dev(0),
32  m_channel(-1),
33  m_source(0),
34  m_sink(0),
35  m_thread(0),
36  m_threadWasRunning(false),
37  m_first_1pps_count(true),
40 {}
XTRXOutput * m_sink
XTRXInput * m_source
bool m_threadWasRunning
flag to know if thread needs to be resumed after suspend
uint64_t m_last_1pps_count
DeviceXTRX * m_dev
int m_channel
allocated channel (-1 if none)
uint32_t m_no_1pps_count_change_counter
ThreadInterface * m_thread
holds the thread address if started else 0

◆ ~DeviceXTRXShared()

DeviceXTRXShared::~DeviceXTRXShared ( )

Definition at line 42 of file devicextrxshared.cpp.

43 {}

Member Function Documentation

◆ get_board_temperature()

double DeviceXTRXShared::get_board_temperature ( )

Definition at line 45 of file devicextrxshared.cpp.

References DeviceXTRX::getDevice(), and m_dev.

Referenced by XTRXOutput::handleMessage(), XTRXInput::handleMessage(), XTRXOutput::webapiFormatDeviceReport(), and XTRXInput::webapiFormatDeviceReport().

46 {
47  uint64_t val = 0;
48 
49  int res = xtrx_val_get(m_dev->getDevice(), XTRX_TRX, XTRX_CH_AB, XTRX_BOARD_TEMP, &val);
50 
51  if (res) {
52  return 0;
53  }
54 
55  return val;
56 }
struct xtrx_dev * getDevice()
Definition: devicextrx.h:35
DeviceXTRX * m_dev
unsigned __int64 uint64_t
Definition: rtptypes_win.h:48
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_gps_status()

bool DeviceXTRXShared::get_gps_status ( )

Definition at line 58 of file devicextrxshared.cpp.

References DeviceXTRX::getDevice(), m_dev, m_first_1pps_count, m_last_1pps_count, and m_no_1pps_count_change_counter.

Referenced by XTRXOutput::handleMessage(), XTRXInput::handleMessage(), XTRXOutput::webapiFormatDeviceReport(), and XTRXInput::webapiFormatDeviceReport().

59 {
60  uint64_t val = 0;
61 
62  int res = xtrx_val_get(m_dev->getDevice(), (xtrx_direction_t) 0, XTRX_CH_AB, XTRX_OSC_LATCH_1PPS, &val);
63 
64  if (res)
65  {
66  return false;
67  }
68  else
69  {
71  {
72  m_last_1pps_count = val;
73  m_first_1pps_count = false;
74  }
75  else
76  {
77  if (m_last_1pps_count != val)
78  {
80  m_last_1pps_count = val;
81  }
82  else if (m_no_1pps_count_change_counter != 0)
83  {
85  }
86 
87  }
88 
89  //qDebug("DeviceXTRXShared::get_gps_status: XTRX_OSC_LATCH_1PPS: %lu %u", val, m_no_1pps_count_change_counter);
91  }
92 }
struct xtrx_dev * getDevice()
Definition: devicextrx.h:35
uint64_t m_last_1pps_count
DeviceXTRX * m_dev
uint32_t m_no_1pps_count_change_counter
unsigned __int64 uint64_t
Definition: rtptypes_win.h:48
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_channel

int DeviceXTRXShared::m_channel

◆ m_dev

DeviceXTRX* DeviceXTRXShared::m_dev

◆ m_first_1pps_count

bool DeviceXTRXShared::m_first_1pps_count
private

Definition at line 154 of file devicextrxshared.h.

Referenced by get_gps_status().

◆ m_last_1pps_count

uint64_t DeviceXTRXShared::m_last_1pps_count
private

Definition at line 155 of file devicextrxshared.h.

Referenced by get_gps_status().

◆ m_no_1pps_count_change_counter

uint32_t DeviceXTRXShared::m_no_1pps_count_change_counter
private

Definition at line 156 of file devicextrxshared.h.

Referenced by get_gps_status().

◆ m_sampleFifoLengthInSeconds

const float DeviceXTRXShared::m_sampleFifoLengthInSeconds = 0.25
static

Definition at line 144 of file devicextrxshared.h.

◆ m_sampleFifoMinSize

const int DeviceXTRXShared::m_sampleFifoMinSize = 48000
static

Definition at line 145 of file devicextrxshared.h.

◆ m_sink

XTRXOutput* DeviceXTRXShared::m_sink

Definition at line 139 of file devicextrxshared.h.

Referenced by XTRXOutput::closeDevice(), and XTRXOutput::openDevice().

◆ m_source

XTRXInput* DeviceXTRXShared::m_source

Definition at line 138 of file devicextrxshared.h.

Referenced by XTRXInput::closeDevice(), and XTRXInput::openDevice().

◆ m_thread

ThreadInterface* DeviceXTRXShared::m_thread

◆ m_threadWasRunning

bool DeviceXTRXShared::m_threadWasRunning

flag to know if thread needs to be resumed after suspend

Definition at line 142 of file devicextrxshared.h.

Referenced by XTRXOutput::resumeRxThread(), XTRXInput::resumeTxThread(), XTRXOutput::suspendRxThread(), and XTRXInput::suspendTxThread().


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