aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPiotr Krysik <ptrkrysik@gmail.com>2017-11-11 11:19:26 +0100
committerPiotr Krysik <ptrkrysik@gmail.com>2017-11-11 11:19:26 +0100
commitba8b0a95d3824bbef9baec6ed30fcd22691413ae (patch)
tree69f01bc1c933c3b92b935a1506315e3ed00d27aa /lib
parentf849fafd92c254a6f3897b08c6655f1cace90398 (diff)
Fix: protections in txtime_setter against late bursts and bursts in too distant future.
Fixing bursts in too distant future is a bit problematic and better way than just looking at tx_time difference from current time would be desirable. This way of fixing that issue can still cause that tx part will do nothing for about 10 seconds (after switching frequency from a BTS1 (with fn1) to BTS2 (with fn2) when fn1>fn2).
Diffstat (limited to 'lib')
-rw-r--r--lib/transmitter/txtime_setter_impl.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/transmitter/txtime_setter_impl.cc b/lib/transmitter/txtime_setter_impl.cc
index 9ff1d8a..91fc4ca 100644
--- a/lib/transmitter/txtime_setter_impl.cc
+++ b/lib/transmitter/txtime_setter_impl.cc
@@ -103,11 +103,22 @@ namespace gr {
txtime_spec = txtime_spec - d_delay_correction;
txtime_spec = txtime_spec - d_timing_advance;
- pmt::pmt_t tags_dict = pmt::dict_add(pmt::make_dict(), pmt::intern("tx_time"), pmt::make_tuple(pmt::from_uint64(txtime_spec.get_full_secs()),pmt::from_double(txtime_spec.get_frac_secs())));
- tags_dict = pmt::dict_add(tags_dict, pmt::intern("fn"), pmt::from_uint64(frame_nr));
- tags_dict = pmt::dict_add(tags_dict, pmt::intern("ts"), pmt::from_uint64(ts_num));
- pmt::pmt_t new_msg = pmt::cons(tags_dict, pmt::cdr(burst));
- message_port_pub(pmt::intern("bursts_out"), new_msg);
+ if(txtime_spec <= time_spec_t(d_time_hint.first, d_time_hint.second))
+ {
+ std::cout << "lB" << std::flush;
+ }
+ else if(txtime_spec > time_spec_t(d_time_hint.first, d_time_hint.second)+10.0)
+ {
+ std::cout << "eB" << std::flush;
+ }
+ else
+ {
+ pmt::pmt_t tags_dict = pmt::dict_add(pmt::make_dict(), pmt::intern("tx_time"), pmt::make_tuple(pmt::from_uint64(txtime_spec.get_full_secs()),pmt::from_double(txtime_spec.get_frac_secs())));
+ tags_dict = pmt::dict_add(tags_dict, pmt::intern("fn"), pmt::from_uint64(frame_nr));
+ tags_dict = pmt::dict_add(tags_dict, pmt::intern("ts"), pmt::from_uint64(ts_num));
+ pmt::pmt_t new_msg = pmt::cons(tags_dict, pmt::cdr(burst));
+ message_port_pub(pmt::intern("bursts_out"), new_msg);
+ }
}
}