summaryrefslogtreecommitdiffstats
path: root/src/OutputUHDFeedback.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-05-12 10:20:23 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-05-12 10:20:23 +0200
commit5ac10e37d07cfe723ea4b396f08563889dff5a2b (patch)
tree54ebe59f371b216ae2f9253ac05dfc5b87b28238 /src/OutputUHDFeedback.h
parent9bf9469ccdc037d26ccd69ac9e81e64d74fc7008 (diff)
downloaddabmod-5ac10e37d07cfe723ea4b396f08563889dff5a2b.tar.gz
dabmod-5ac10e37d07cfe723ea4b396f08563889dff5a2b.tar.bz2
dabmod-5ac10e37d07cfe723ea4b396f08563889dff5a2b.zip
Properly terminate dpd server on ctrl-c
Diffstat (limited to 'src/OutputUHDFeedback.h')
-rw-r--r--src/OutputUHDFeedback.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/OutputUHDFeedback.h b/src/OutputUHDFeedback.h
index afc06b0..32668b6 100644
--- a/src/OutputUHDFeedback.h
+++ b/src/OutputUHDFeedback.h
@@ -44,6 +44,7 @@ DESCRIPTION:
#include <boost/thread.hpp>
#include <memory>
#include <string>
+#include <atomic>
#include "Log.h"
#include "TimestampDecoder.h"
@@ -62,21 +63,23 @@ struct UHDReceiveBurstRequest {
BurstRequestState state;
- // In the SaveTransmit states, frame_length samples are saved into
+ // In the SaveTransmit states, num_samples complexf samples are saved into
// the vectors
- size_t frame_length;
+ size_t num_samples;
// The timestamp of the first sample of the TX buffers
uint32_t tx_second;
uint32_t tx_pps; // in units of 1/16384000s
+ // Samples contain complexf, but since our internal representation is uint8_t
+ // we keep it like that
std::vector<uint8_t> tx_samples;
// The timestamp of the first sample of the RX buffers
uint32_t rx_second;
uint32_t rx_pps;
- std::vector<uint8_t> rx_samples;
+ std::vector<uint8_t> rx_samples; // Also, actually complexf
};
// Serve TX samples and RX feedback samples over a TCP connection
@@ -104,7 +107,8 @@ class OutputUHDFeedback {
UHDReceiveBurstRequest burstRequest;
- bool m_running = false;
+ std::atomic_bool m_running;
+ int m_server_sock = -1;
uint16_t m_port = 0;
uint32_t m_sampleRate = 0;
uhd::usrp::multi_usrp::sptr m_usrp;