diff --git a/include/openthread/link.h b/include/openthread/link.h index d4abe9836..ccca40d8a 100644 --- a/include/openthread/link.h +++ b/include/openthread/link.h @@ -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. * diff --git a/src/core/api/link_api.cpp b/src/core/api/link_api.cpp index 9e89f3aeb..4bd975829 100644 --- a/src/core/api/link_api.cpp +++ b/src/core/api/link_api.cpp @@ -371,6 +371,13 @@ const otMacCounters *otLinkGetCounters(otInstance *aInstance) return &instance.Get().GetCounters(); } +void otLinkResetCounters(otInstance *aInstance) +{ + Instance &instance = *static_cast(aInstance); + + instance.Get().ResetCounters(); +} + otError otLinkActiveScan(otInstance * aInstance, uint32_t aScanChannels, uint16_t aScanDuration,