aboutsummaryrefslogtreecommitdiffstats
path: root/OutputUHD.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-11-08 21:26:48 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-11-08 21:26:48 +0100
commit05886065ea52559de5800850f728432c826f33b6 (patch)
tree1d5b8f4fdb2e12d52f1638be2ee7cba902e65650 /OutputUHD.cpp
parent22eb9a40a48c24c2794b07f96729ce49697ef298 (diff)
downloadodr-dpd-05886065ea52559de5800850f728432c826f33b6.tar.gz
odr-dpd-05886065ea52559de5800850f728432c826f33b6.tar.bz2
odr-dpd-05886065ea52559de5800850f728432c826f33b6.zip
Move definition of TX timestamp and fix bug after RX reset
Diffstat (limited to 'OutputUHD.cpp')
-rw-r--r--OutputUHD.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/OutputUHD.cpp b/OutputUHD.cpp
index a80f5b9..9536ebd 100644
--- a/OutputUHD.cpp
+++ b/OutputUHD.cpp
@@ -67,14 +67,13 @@ OutputUHD::OutputUHD(double txgain, double rxgain, double samplerate) :
m_usrp->set_rx_gain(m_rxgain);
MDEBUG("OutputUHD:Actual RX Gain: %f ...\n", m_usrp->get_rx_gain());
- double tx_time = m_usrp->get_time_now().get_real_secs();
+ const double usrp_time = m_usrp->get_time_now().get_real_secs();
MDEBUG("OutputUHD: USRP time %f\n",
- tx_time);
+ usrp_time);
md.start_of_burst = false;
md.end_of_burst = false;
md.has_time_spec = true;
- md.time_spec = uhd::time_spec_t(tx_time + 2);
uhd::stream_args_t stream_args("fc32"); //complex floats
myTxStream = m_usrp->get_tx_stream(stream_args);
@@ -89,13 +88,13 @@ OutputUHD::OutputUHD(double txgain, double rxgain, double samplerate) :
}
-size_t OutputUHD::Transmit(const complexf *samples, size_t sizeIn, double *first_sample_time)
+size_t OutputUHD::Transmit(const complexf *samples, size_t sizeIn, double transmit_time)
{
const double tx_timeout = 20.0;
size_t usrp_max_num_samps = myTxStream->get_max_num_samps();
- *first_sample_time = md.time_spec.get_real_secs();
+ md.time_spec = uhd::time_spec_t(transmit_time);
size_t num_acc_samps = 0; //number of accumulated samples
while (num_acc_samps < sizeIn) {