diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2019-03-12 15:28:22 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2019-03-12 15:28:22 +0100 |
commit | 9f1ba12f3640f95ebb56b83069b925c4d63b5f43 (patch) | |
tree | e9f2428acbcb62644c242ae5f3e2339d932c43de /src | |
parent | f656ba53cd6ad89d583f39a982390504a1ec6a94 (diff) | |
download | dabmod-9f1ba12f3640f95ebb56b83069b925c4d63b5f43.tar.gz dabmod-9f1ba12f3640f95ebb56b83069b925c4d63b5f43.tar.bz2 dabmod-9f1ba12f3640f95ebb56b83069b925c4d63b5f43.zip |
Lime: Show fifo fullness in RC
Diffstat (limited to 'src')
-rw-r--r-- | src/output/Lime.cpp | 5 | ||||
-rw-r--r-- | src/output/Lime.h | 1 | ||||
-rw-r--r-- | src/output/SDR.cpp | 20 | ||||
-rw-r--r-- | src/output/SDRDevice.h | 2 |
4 files changed, 26 insertions, 2 deletions
diff --git a/src/output/Lime.cpp b/src/output/Lime.cpp index 3a5f893..fff3dd4 100644 --- a/src/output/Lime.cpp +++ b/src/output/Lime.cpp @@ -355,6 +355,11 @@ double Lime::get_temperature(void) const return temp; } +uint32_t Lime::get_fifo_fill_count(void) const +{ + return m_last_fifo_filled_count; +} + void Lime::transmit_frame(const struct FrameData &frame) { if (not m_device) diff --git a/src/output/Lime.h b/src/output/Lime.h index 8658053..febb878 100644 --- a/src/output/Lime.h +++ b/src/output/Lime.h @@ -81,6 +81,7 @@ class Lime : public Output::SDRDevice virtual const char *device_name(void) const override; virtual double get_temperature(void) const override; + virtual uint32_t get_fifo_fill_count(void) const; private: SDRDeviceConfig &m_conf; diff --git a/src/output/SDR.cpp b/src/output/SDR.cpp index 23a947b..31a5c79 100644 --- a/src/output/SDR.cpp +++ b/src/output/SDR.cpp @@ -25,6 +25,7 @@ */ #include "output/SDR.h" +#include "output/Lime.h" #include "PcDebug.h" #include "Log.h" @@ -83,6 +84,10 @@ SDR::SDR(SDRDeviceConfig& config, std::shared_ptr<SDRDevice> device) : RC_ADD_PARAMETER(frames, "Counter of number of frames modulated"); RC_ADD_PARAMETER(gpsdo_num_sv, "Number of Satellite Vehicles tracked by GPSDO"); RC_ADD_PARAMETER(gpsdo_holdover, "1 if the GPSDO is in holdover, 0 if it is using gnss"); + + if (std::dynamic_pointer_cast<Lime>(device)) { + RC_ADD_PARAMETER(fifo_fill, "A value representing the Lime FIFO fullness"); + } } SDR::~SDR() @@ -388,7 +393,8 @@ void SDR::set_parameter(const string& parameter, const string& value) parameter == "latepackets" or parameter == "frames" or parameter == "gpsdo_num_sv" or - parameter == "gpsdo_holdover") { + parameter == "gpsdo_holdover" or + parameter == "fifo_fill") { throw ParameterError("Parameter " + parameter + " is read-only."); } else { @@ -453,6 +459,18 @@ const string SDR::get_parameter(const string& parameter) const const auto stat = m_device->get_run_statistics(); ss << (stat.gpsdo_holdover ? 1 : 0); } + else if (parameter == "fifo_fill") { + const auto dev = std::dynamic_pointer_cast<Lime>(m_device); + + if (dev) { + ss << dev->get_fifo_fill_count(); + } + else { + ss << "Parameter '" << parameter << + "' is not exported by controllable " << get_rc_name(); + throw ParameterError(ss.str()); + } + } else { ss << "Parameter '" << parameter << "' is not exported by controllable " << get_rc_name(); diff --git a/src/output/SDRDevice.h b/src/output/SDRDevice.h index 9796479..7ab4bc8 100644 --- a/src/output/SDRDevice.h +++ b/src/output/SDRDevice.h @@ -2,7 +2,7 @@ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2017 + Copyright (C) 2019 Matthias P. Braendli, matthias.braendli@mpb.li http://opendigitalradio.org |