mirror of
https://github.com/espressif/openthread.git
synced 2026-07-30 07:37:46 +00:00
[link-metrics] add reverse linear scale for metrics in enh ack (#7035)
This commit add missing reverse operations for linear scale RSSI and link margin for enhance acknowledgments.
This commit is contained in:
@@ -602,11 +602,13 @@ void LinkMetrics::ProcessEnhAckIeData(const uint8_t *aData, uint8_t aLength, con
|
||||
}
|
||||
if (values.GetMetrics().mLinkMargin && idx < aLength)
|
||||
{
|
||||
values.mLinkMarginValue = aData[idx++];
|
||||
// Reverse operation for linear scale, map from [0, 255] to [0, 130]
|
||||
values.mLinkMarginValue = aData[idx++] * 130 / 255;
|
||||
}
|
||||
if (values.GetMetrics().mRssi && idx < aLength)
|
||||
{
|
||||
values.mRssiValue = aData[idx++];
|
||||
// Reverse operation for linear scale, map from [0, 255] to [-130, 0]
|
||||
values.mRssiValue = aData[idx++] * 130 / 255 - 130;
|
||||
}
|
||||
|
||||
mEnhAckProbingIeReportCallback(aNeighbor.GetRloc16(), &aNeighbor.GetExtAddress(), &values,
|
||||
|
||||
Reference in New Issue
Block a user