[utils] add API to reset/clear linked list of enh-ack link metrics (#10294)

Enh-ack link metrics required to reset/clear when radio(RCP) is reset to
clear existing data. To support it, added API to reset/clear linked list
of enh-ack link metrics.

Signed-off-by: Ashishkumar Vara <ashish.vara@nxp.com>
This commit is contained in:
Ashish
2024-05-30 23:51:35 +05:30
committed by GitHub
parent 8d38fc76af
commit bef804c6be
2 changed files with 17 additions and 1 deletions
+11 -1
View File
@@ -177,7 +177,11 @@ static inline bool IsLinkMetricsClear(otLinkMetrics aLinkMetrics)
return !aLinkMetrics.mPduCount && !aLinkMetrics.mLqi && !aLinkMetrics.mLinkMargin && !aLinkMetrics.mRssi;
}
void otLinkMetricsInit(int8_t aNoiseFloor) { sNoiseFloor = aNoiseFloor; }
void otLinkMetricsInit(int8_t aNoiseFloor)
{
sNoiseFloor = aNoiseFloor;
otLinkMetricsResetEnhAckProbing();
}
otError otLinkMetricsConfigureEnhAckProbing(otShortAddress aShortAddress,
const otExtAddress *aExtAddress,
@@ -257,4 +261,10 @@ uint8_t otLinkMetricsEnhAckGetDataLen(const otMacAddress *aMacAddress)
exit:
return len;
}
void otLinkMetricsResetEnhAckProbing(void)
{
GetLinkMetricsDataInfoActiveList().Clear();
GetLinkMetricsDataInfoPool().FreeAll();
}
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
+6
View File
@@ -107,6 +107,12 @@ uint8_t otLinkMetricsEnhAckGenData(const otMacAddress *aMacAddress, uint8_t aLqi
*/
uint8_t otLinkMetricsEnhAckGetDataLen(const otMacAddress *aMacAddress);
/**
* This method resets Enhanced-ACK Based Probing data.
*
*/
void otLinkMetricsResetEnhAckProbing(void);
#ifdef __cplusplus
} // extern "C"
#endif