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;