proc_bsr: refactor and add extra print_state() method

allows to call the print_state() routine from other places in the BSR
This commit is contained in:
Andre Puschmann 2020-10-26 10:21:54 +01:00
parent d1ef5bd915
commit d5286e70aa
2 changed files with 15 additions and 9 deletions

View File

@ -96,6 +96,7 @@ private:
typedef enum { NONE, REGULAR, PADDING, PERIODIC } triggered_bsr_type_t;
triggered_bsr_type_t triggered_bsr_type = NONE;
void print_state();
void set_trigger(triggered_bsr_type_t new_trigger);
void update_new_data();
void update_buffer_state();

View File

@ -45,6 +45,17 @@ void bsr_proc::init(sr_proc* sr_,
// Print periodically the LCID queue status
auto queue_status_print_task = [this](uint32_t tid) {
print_state();
timer_queue_status_print.run();
};
timer_queue_status_print.set(QUEUE_STATUS_PERIOD_MS, queue_status_print_task);
timer_queue_status_print.run();
initiated = true;
}
void bsr_proc::print_state()
{
char str[128];
str[0] = '\0';
int n = 0;
@ -54,12 +65,6 @@ void bsr_proc::init(sr_proc* sr_,
}
}
Info("BSR: triggered_bsr_type=%s, LCID QUEUE status: %s\n", bsr_type_tostring(triggered_bsr_type), str);
timer_queue_status_print.run();
};
timer_queue_status_print.set(QUEUE_STATUS_PERIOD_MS, queue_status_print_task);
timer_queue_status_print.run();
initiated = true;
}
void bsr_proc::set_trigger(srsue::bsr_proc::triggered_bsr_type_t new_trigger)