Skip to content

Commit 7558fe1

Browse files
authored
Return empty thread route table when there is no route instead of an error (#37032)
Signed-off-by: Martin Girardot <martin.girardot@nxp.com>
1 parent 0dd3414 commit 7558fe1

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-provider.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,6 @@ CHIP_ERROR WriteThreadNetworkDiagnosticAttributeToTlv(AttributeId attributeId, a
248248

249249
#if CHIP_DEVICE_CONFIG_THREAD_FTD
250250
uint8_t maxRouterId = otThreadGetMaxRouterId(otInst);
251-
CHIP_ERROR chipErr = CHIP_ERROR_INCORRECT_STATE;
252-
253251
for (uint8_t i = 0; i <= maxRouterId; i++)
254252
{
255253
if (otThreadGetRouterInfo(otInst, i, &routerInfo) == OT_ERROR_NONE)
@@ -268,11 +266,10 @@ CHIP_ERROR WriteThreadNetworkDiagnosticAttributeToTlv(AttributeId attributeId, a
268266
routeTable.linkEstablished = routerInfo.mLinkEstablished;
269267

270268
ReturnErrorOnFailure(aEncoder.Encode(routeTable));
271-
chipErr = CHIP_NO_ERROR;
272269
}
273270
}
274-
275-
return chipErr;
271+
// Returning empty list with no error in case thread network is not up
272+
return CHIP_NO_ERROR;
276273

277274
#else // OPENTHREAD_MTD
278275
otError otErr = otThreadGetParentInfo(otInst, &routerInfo);

0 commit comments

Comments
 (0)