[link] add public OT API otLinkResetCounters to reset MAC counters (#4286)

This commit is contained in:
Abtin Keshavarzian
2019-10-31 15:23:22 -07:00
committed by Jonathan Hui
parent bf03f40bd7
commit 7d80c16df8
2 changed files with 15 additions and 0 deletions
+8
View File
@@ -751,6 +751,14 @@ int8_t otLinkConvertLinkQualityToRss(otInstance *aInstance, uint8_t aLinkQuality
*/
const otMacCounters *otLinkGetCounters(otInstance *aInstance);
/**
* Reset the MAC layer counters.
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
*/
void otLinkResetCounters(otInstance *aInstance);
/**
* This function pointer is called when an IEEE 802.15.4 frame is received.
*
+7
View File
@@ -371,6 +371,13 @@ const otMacCounters *otLinkGetCounters(otInstance *aInstance)
return &instance.Get<Mac::Mac>().GetCounters();
}
void otLinkResetCounters(otInstance *aInstance)
{
Instance &instance = *static_cast<Instance *>(aInstance);
instance.Get<Mac::Mac>().ResetCounters();
}
otError otLinkActiveScan(otInstance * aInstance,
uint32_t aScanChannels,
uint16_t aScanDuration,