rrm: fix bad sign for calculating RCPI
PATCH 1/1 rrm: fix bad sign for calculating RCPI
The first if case should be -10950, not 10950. Without the negative this first case would get hit every time since signal strength values are always negative.
--- src/rrm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/rrm.c +1 -1
@@ -243,7 +243,7 @@ static void rrm_build_measurement_report(struct rrm_request_info *info,/* 802.11 Table 9-154 */ static uint8_t mdb_to_rcpi (int32_t mdb) { -if (mdb <=10950 ) +if (mdb <=-10950 )return 0 ;else if (mdb >=-10950 && mdb <0 )return (2 * (mdb +11000 )) /100 ;
Signature · 1 line
2.17.1
Hi James,
Quoted 6 lines
The first if case should be -10950, not 10950. Without the negative this first case would get hit every time since signal strength values are always negative.
---src/rrm.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
patch has been applied.
Regards
Marcel