[mle] add MLE counters (#2982)

This commit adds support for a set of MLE counters (e.g., counters to
track number of times device entered different roles, or counters
tracking number of attach attempts, partition ID or parent changes).
This commit is contained in:
Abtin Keshavarzian
2018-09-07 00:01:31 -07:00
committed by Jonathan Hui
parent abfb16eb7f
commit 144a4e3e06
4 changed files with 107 additions and 0 deletions
+14
View File
@@ -524,3 +524,17 @@ const otIpCounters *otThreadGetIp6Counters(otInstance *aInstance)
return &instance.GetThreadNetif().GetMeshForwarder().GetCounters();
}
const otMleCounters *otThreadGetMleCounters(otInstance *aInstance)
{
Instance &instance = *static_cast<Instance *>(aInstance);
return &instance.GetThreadNetif().GetMle().GetCounters();
}
void otThreadResetMleCounters(otInstance *aInstance)
{
Instance &instance = *static_cast<Instance *>(aInstance);
instance.GetThreadNetif().GetMle().ResetCounters();
}