Skip to content

Commit afefcb9

Browse files
xavierarteagacodebot
authored andcommitted
gnb: PRACH warning printed only once
1 parent ccb4e87 commit afefcb9

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

lib/phy/upper/channel_processors/prach_detector_phy_validator_impl.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "prach_detector_generic_thresholds.h"
2020
#include "srsran/phy/upper/channel_processors/prach_detector_phy_validator.h"
21+
#include <set>
2122

2223
using namespace srsran;
2324

@@ -46,13 +47,19 @@ bool srsran::validate_prach_detector_phy(prach_format_type format,
4647
}
4748

4849
if (flag == detail::threshold_and_margin_finder::threshold_flag::orange) {
49-
fmt::print(
50-
"\nThe PRACH detector will not meet the performance requirements with the configuration {{Format {}, ZCZ "
51-
"{}, SCS {}, Rx ports {}}}.\n",
52-
to_string(format),
53-
zero_correlation_zone,
54-
to_string(scs),
55-
nof_rx_ports);
50+
// Contains the PRACH threshold parameters that have already reported orange.
51+
static std::set<detail::threshold_params> prach_detector_phy_validator_orange_set;
52+
53+
// Print message only once.
54+
if (prach_detector_phy_validator_orange_set.count(th_params) == 0) {
55+
fmt::print("\nThe PRACH detector will not meet the performance requirements with the configuration {{Format {}, "
56+
"ZCZ {}, SCS {}, Rx ports {}}}.\n",
57+
to_string(format),
58+
zero_correlation_zone,
59+
to_string(scs),
60+
nof_rx_ports);
61+
prach_detector_phy_validator_orange_set.emplace(th_params);
62+
}
5663
}
5764
return true;
5865
}

0 commit comments

Comments
 (0)