summaryrefslogtreecommitdiffstats
path: root/src/output/SDR.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-03-12 15:28:22 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-03-12 15:28:22 +0100
commit9f1ba12f3640f95ebb56b83069b925c4d63b5f43 (patch)
treee9f2428acbcb62644c242ae5f3e2339d932c43de /src/output/SDR.cpp
parentf656ba53cd6ad89d583f39a982390504a1ec6a94 (diff)
downloaddabmod-9f1ba12f3640f95ebb56b83069b925c4d63b5f43.tar.gz
dabmod-9f1ba12f3640f95ebb56b83069b925c4d63b5f43.tar.bz2
dabmod-9f1ba12f3640f95ebb56b83069b925c4d63b5f43.zip
Lime: Show fifo fullness in RC
Diffstat (limited to 'src/output/SDR.cpp')
-rw-r--r--src/output/SDR.cpp20
1 files changed, 19 insertions, 1 deletions
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();