proc_bsr: fix high priority channel trigger logic

this fixes the trigger logic for periodic BSRs. Previously we
would always trigger the "new data for highest priority LCID"
whenever new data becomes available for a LCID for which
a BSR has already been sent.

However, a BSR should only be sent if the priority is in fact higher
(lower int number).
This commit is contained in:
Andre Puschmann 2020-10-26 10:50:30 +01:00
parent debbab93e8
commit 1e3ad5b0dc
1 changed files with 4 additions and 2 deletions

View File

@ -141,11 +141,13 @@ bool bsr_proc::check_highest_channel()
for (std::map<uint32_t, lcid_t>::iterator iter = lcgs[i].begin(); iter != lcgs[i].end(); ++iter) {
// If new data available
if (iter->second.new_buffer > iter->second.old_buffer) {
// Check if this lcid has higher priority than any other LCID in the group for which data is available
// Check if this LCID has higher priority than any other LCID ("belong to any LCG") for which data is already
// available for transmission
bool is_max_priority = true;
for (int j = 0; j < NOF_LCG; j++) {
for (std::map<uint32_t, lcid_t>::iterator iter2 = lcgs[j].begin(); iter2 != lcgs[j].end(); ++iter2) {
if (iter2->second.priority < iter->second.priority && iter2->second.old_buffer) {
// No max prio LCG if prio isn't higher or LCID already had buffered data
if (iter2->second.priority <= iter->second.priority && (iter2->second.old_buffer > 0)) {
is_max_priority = false;
}
}