[network-diagnostic] REED should omit ChildTable TLV request (#2772)

This commit is contained in:
rongli
2018-06-11 08:56:22 -07:00
committed by Jonathan Hui
parent 631557e81f
commit 2f9bd174d0
+8 -2
View File
@@ -394,13 +394,19 @@ otError NetworkDiagnostic::FillRequestedTlvs(Message & aRequest,
case NetworkDiagnosticTlv::kSupplyVoltage:
{
// Thread 1.1.1 Specification Section 10.11.4.3:
// Omitted if the battery level is not measured, is unknown.
// Omitted if the supply voltage is not measured, is unknown.
break;
}
case NetworkDiagnosticTlv::kChildTable:
{
SuccessOrExit(error = AppendChildTable(aResponse));
// Thread 1.1.1 Specification Section 10.11.2.2:
// If a Thread device is unable to supply a specific Diagnostic TLV, that TLV is omitted.
// Here only Leader or Router may have children.
if (netif.GetMle().GetRole() == OT_DEVICE_ROLE_LEADER || netif.GetMle().GetRole() == OT_DEVICE_ROLE_ROUTER)
{
SuccessOrExit(error = AppendChildTable(aResponse));
}
break;
}