Draft: Enable PHR reporting for NR UE
Commit 1: Enable PHR Reporting for NR UE. Locally tested OK.
Commit 2: Fix power headroom calculation on reception of PHR in gNB
PHR table from 38.133
if (phr->PH < 55) PH = phr->PH - 32; else PH = phr->PH - 32 + (phr->PH - 54);}
I am assuming the PH value here is the upper bound of power headroom since with this assumption the if(PH < 55)
case is correct.
However the else case is incorrect, observe edge cases below:
for POWER_HEADROOM_63 PH >=42, but the calculation above gives 63 + 63 - 32 - 54 = 40
for POWER_HEADROOM_55 27 <= PH < 28, but the result is 55 + 55 - 32 - 54 = 24
Edited by Bartosz Podrygajlo