diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2021-01-12 21:39:36 +0100 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2021-01-20 22:04:55 +0000 |
commit | 3e1dad2a376f61ff4a2f507dba795de038efcf11 (patch) | |
tree | d765ef60497a1a9c7de2cd5d052ba56799a7c7d2 /src | |
parent | bb6765a93c06de65ce054776b207cdef3efe89c3 (diff) |
power_control: print current RxLev and lower/upper thresholds
This makes the logging messages easier to read and understand.
Change-Id: I5f8c987054b2b01acdb9f525d06ca15bbc577070
Related: SYS#4918
Diffstat (limited to 'src')
-rw-r--r-- | src/common/power_control.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/common/power_control.c b/src/common/power_control.c index 6620add2..97baeb71 100644 --- a/src/common/power_control.c +++ b/src/common/power_control.c @@ -316,19 +316,24 @@ int lchan_bs_pwr_ctrl(struct gsm_lchan *lchan, if (new < 0) new = 0; - /* FIXME: this is only needed for logging, print thresholds instead */ - int target_dbm = rxlev2dbm(CALC_TARGET(params->rxlev_meas)); - if (state->current != new) { LOGPLCHAN(lchan, DLOOP, LOGL_INFO, "Changing Downlink attenuation: " - "%u -> %u dB (maximum %u dB, target %d dBm, delta %d dB)\n", - state->current, new, state->max, target_dbm, delta); + "%u -> %u dB (maximum %u dB, delta %d dB, " + "RxLev current %u (%d dBm), thresholds %u .. %u)\n", + state->current, new, state->max, + delta, rxlev, rxlev2dbm(rxlev), + params->rxlev_meas.lower_thresh, + params->rxlev_meas.upper_thresh); state->current = new; return 1; } else { LOGPLCHAN(lchan, DLOOP, LOGL_INFO, "Keeping Downlink attenuation " - "at %u dB (maximum %u dB, target %d dBm, delta %d dB)\n", - state->current, state->max, target_dbm, delta); + "at %u dB (maximum %u dB, delta %d dB, " + "RxLev current %u (%d dBm), thresholds %u .. %u)\n", + state->current, state->max, + delta, rxlev, rxlev2dbm(rxlev), + params->rxlev_meas.lower_thresh, + params->rxlev_meas.upper_thresh); return 0; } } |