Added function for subtraction of timeslots from bursts counter
diff --git a/lib/receiver/receiver_config.cc b/lib/receiver/receiver_config.cc
index c8b85c7..0abf200 100644
--- a/lib/receiver/receiver_config.cc
+++ b/lib/receiver/receiver_config.cc
@@ -46,6 +46,33 @@
return (*this);
}
+burst_counter burst_counter::subtract_timeslots(unsigned int number_of_timeslots)
+{
+ int timeslot_nr = (int)d_timeslot_nr - (int)number_of_timeslots;
+ int t1,t2,t3;
+ if (timeslot_nr < 0) {
+ timeslot_nr = timeslot_nr + 8;
+
+ t2 = (d_t2 - 1) % 26;
+ t3 = (d_t3 - 1) % 51;
+
+ if ((d_t2 == 0) && (d_t3 == 0)) {
+ t1 = (d_t1 - 1) % (1 << 11);
+ } else
+ {
+ t1 = d_t1;
+ }
+ }
+ else
+ {
+ t1 = d_t1;
+ t2 = d_t2;
+ t3 = d_t3;
+ }
+
+ return burst_counter(d_OSR, t1, t2, t3, timeslot_nr);
+}
+
void burst_counter::set(uint32_t t1, uint32_t t2, uint32_t t3, uint32_t timeslot_nr)
{
d_t1 = t1;
diff --git a/lib/receiver/receiver_config.h b/lib/receiver/receiver_config.h
index 496e1fe..17b98c8 100644
--- a/lib/receiver/receiver_config.h
+++ b/lib/receiver/receiver_config.h
@@ -89,12 +89,14 @@
d_t3(t3),
d_timeslot_nr(timeslot_nr),
d_offset_fractional(0.0),
- d_offset_integer(0.0) {
+ d_offset_integer(0.0)
+ {
d_offset_integer = 0;
d_offset_fractional = 0;
}
burst_counter & operator++(int);
+ burst_counter subtract_timeslots(unsigned int number_of_timeslots);
void set(uint32_t t1, uint32_t t2, uint32_t t3, uint32_t timeslot_nr);
uint32_t get_t1() {