Skip to content

Commit

Permalink
Return empty thread route table when there is no route instead of an …
Browse files Browse the repository at this point in the history
…error

Signed-off-by: Martin Girardot <martin.girardot@nxp.com>
  • Loading branch information
Martin-NXP committed Jan 10, 2025
1 parent b528132 commit db43f5e
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,6 @@ CHIP_ERROR WriteThreadNetworkDiagnosticAttributeToTlv(AttributeId attributeId, a

#if CHIP_DEVICE_CONFIG_THREAD_FTD
uint8_t maxRouterId = otThreadGetMaxRouterId(otInst);
CHIP_ERROR chipErr = CHIP_ERROR_INCORRECT_STATE;

for (uint8_t i = 0; i <= maxRouterId; i++)
{
if (otThreadGetRouterInfo(otInst, i, &routerInfo) == OT_ERROR_NONE)
Expand All @@ -268,11 +266,10 @@ CHIP_ERROR WriteThreadNetworkDiagnosticAttributeToTlv(AttributeId attributeId, a
routeTable.linkEstablished = routerInfo.mLinkEstablished;

ReturnErrorOnFailure(aEncoder.Encode(routeTable));
chipErr = CHIP_NO_ERROR;
}
}

return chipErr;
// Returning empty list with no error in case thread network is not up
return CHIP_NO_ERROR;

#else // OPENTHREAD_MTD
otError otErr = otThreadGetParentInfo(otInst, &routerInfo);
Expand Down

0 comments on commit db43f5e

Please sign in to comment.