aboutsummaryrefslogtreecommitdiffstats
path: root/src/OutputUHD.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-02-27 13:52:54 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-02-27 13:52:54 +0100
commitb11eff2c8c913d470897e5395b240939ed46dc35 (patch)
tree9661cb7b8dab3c4b2ab6123a64c020b01605fdec /src/OutputUHD.h
parent5971e74e6b23b9980af23ac35f3032970adc426b (diff)
downloaddabmod-b11eff2c8c913d470897e5395b240939ed46dc35.tar.gz
dabmod-b11eff2c8c913d470897e5395b240939ed46dc35.tar.bz2
dabmod-b11eff2c8c913d470897e5395b240939ed46dc35.zip
Restart whole modulator on FCT discontinuity
Diffstat (limited to 'src/OutputUHD.h')
-rw-r--r--src/OutputUHD.h27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/OutputUHD.h b/src/OutputUHD.h
index c5d561b..d92c7a4 100644
--- a/src/OutputUHD.h
+++ b/src/OutputUHD.h
@@ -83,9 +83,20 @@ struct UHDWorkerFrameData {
struct frame_timestamp ts;
};
+struct fct_discontinuity_error : public std::exception
+{
+ const char* what () const throw ()
+ {
+ return "FCT discontinuity detected";
+ }
+};
+
enum refclk_lock_loss_behaviour_t { CRASH, IGNORE };
struct UHDWorkerData {
+ bool running;
+ bool failed_due_to_fct;
+
#if FAKE_UHD == 0
uhd::usrp::multi_usrp::sptr myUsrp;
#endif
@@ -130,28 +141,26 @@ struct UHDWorkerData {
class UHDWorker {
public:
- UHDWorker () {
- running = false;
- }
-
void start(struct UHDWorkerData *uhdworkerdata) {
- running = true;
uwd = uhdworkerdata;
- uhd_thread = boost::thread(&UHDWorker::process, this);
+
+ uwd->running = true;
+ uwd->failed_due_to_fct = false;
+ uhd_thread = boost::thread(&UHDWorker::process_errhandler, this);
}
void stop() {
- running = false;
+ uwd->running = false;
uhd_thread.interrupt();
uhd_thread.join();
}
+ private:
void process();
+ void process_errhandler();
- private:
struct UHDWorkerData *uwd;
- bool running;
boost::thread uhd_thread;
uhd::tx_streamer::sptr myTxStream;