Skip to content

Commit

Permalink
Fix general attributes read
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartinez-silabs committed Jan 30, 2024
1 parent d9938ba commit 133e259
Showing 1 changed file with 72 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,78 @@ CHIP_ERROR ThreadDiagosticsAttrAccess::Read(const ConcreteReadAttributePath & aP
// We shouldn't have been called at all.
return CHIP_ERROR_INVALID_ARGUMENT;
}
return WriteThreadNetworkDiagnosticAttributeToTlv(aPath.mAttributeId, aEncoder);

switch (aPath.mAttributeId)
{
case ThreadNetworkDiagnostics::Attributes::NeighborTable::Id:
case ThreadNetworkDiagnostics::Attributes::RouteTable::Id:
case ThreadNetworkDiagnostics::Attributes::SecurityPolicy::Id:
case ThreadNetworkDiagnostics::Attributes::OperationalDatasetComponents::Id:
case ThreadNetworkDiagnostics::Attributes::ActiveNetworkFaultsList::Id:
case ThreadNetworkDiagnostics::Attributes::Channel::Id:
case ThreadNetworkDiagnostics::Attributes::RoutingRole::Id:
case ThreadNetworkDiagnostics::Attributes::NetworkName::Id:
case ThreadNetworkDiagnostics::Attributes::PanId::Id:
case ThreadNetworkDiagnostics::Attributes::ExtendedPanId::Id:
case ThreadNetworkDiagnostics::Attributes::MeshLocalPrefix::Id:
case ThreadNetworkDiagnostics::Attributes::PartitionId::Id:
case ThreadNetworkDiagnostics::Attributes::Weighting::Id:
case ThreadNetworkDiagnostics::Attributes::DataVersion::Id:
case ThreadNetworkDiagnostics::Attributes::StableDataVersion::Id:
case ThreadNetworkDiagnostics::Attributes::LeaderRouterId::Id:
case ThreadNetworkDiagnostics::Attributes::OverrunCount::Id:
case ThreadNetworkDiagnostics::Attributes::DetachedRoleCount::Id:
case ThreadNetworkDiagnostics::Attributes::ChildRoleCount::Id:
case ThreadNetworkDiagnostics::Attributes::RouterRoleCount::Id:
case ThreadNetworkDiagnostics::Attributes::LeaderRoleCount::Id:
case ThreadNetworkDiagnostics::Attributes::AttachAttemptCount::Id:
case ThreadNetworkDiagnostics::Attributes::PartitionIdChangeCount::Id:
case ThreadNetworkDiagnostics::Attributes::BetterPartitionAttachAttemptCount::Id:
case ThreadNetworkDiagnostics::Attributes::ParentChangeCount::Id:
case ThreadNetworkDiagnostics::Attributes::TxTotalCount::Id:
case ThreadNetworkDiagnostics::Attributes::TxUnicastCount::Id:
case ThreadNetworkDiagnostics::Attributes::TxBroadcastCount::Id:
case ThreadNetworkDiagnostics::Attributes::TxAckRequestedCount::Id:
case ThreadNetworkDiagnostics::Attributes::TxAckedCount::Id:
case ThreadNetworkDiagnostics::Attributes::TxNoAckRequestedCount::Id:
case ThreadNetworkDiagnostics::Attributes::TxDataCount::Id:
case ThreadNetworkDiagnostics::Attributes::TxDataPollCount::Id:
case ThreadNetworkDiagnostics::Attributes::TxBeaconCount::Id:
case ThreadNetworkDiagnostics::Attributes::TxBeaconRequestCount::Id:
case ThreadNetworkDiagnostics::Attributes::TxOtherCount::Id:
case ThreadNetworkDiagnostics::Attributes::TxRetryCount::Id:
case ThreadNetworkDiagnostics::Attributes::TxDirectMaxRetryExpiryCount::Id:
case ThreadNetworkDiagnostics::Attributes::TxIndirectMaxRetryExpiryCount::Id:
case ThreadNetworkDiagnostics::Attributes::TxErrCcaCount::Id:
case ThreadNetworkDiagnostics::Attributes::TxErrAbortCount::Id:
case ThreadNetworkDiagnostics::Attributes::TxErrBusyChannelCount::Id:
case ThreadNetworkDiagnostics::Attributes::RxTotalCount::Id:
case ThreadNetworkDiagnostics::Attributes::RxUnicastCount::Id:
case ThreadNetworkDiagnostics::Attributes::RxBroadcastCount::Id:
case ThreadNetworkDiagnostics::Attributes::RxDataCount::Id:
case ThreadNetworkDiagnostics::Attributes::RxDataPollCount::Id:
case ThreadNetworkDiagnostics::Attributes::RxBeaconCount::Id:
case ThreadNetworkDiagnostics::Attributes::RxBeaconRequestCount::Id:
case ThreadNetworkDiagnostics::Attributes::RxOtherCount::Id:
case ThreadNetworkDiagnostics::Attributes::RxAddressFilteredCount::Id:
case ThreadNetworkDiagnostics::Attributes::RxDestAddrFilteredCount::Id:
case ThreadNetworkDiagnostics::Attributes::RxDuplicatedCount::Id:
case ThreadNetworkDiagnostics::Attributes::RxErrNoFrameCount::Id:
case ThreadNetworkDiagnostics::Attributes::RxErrUnknownNeighborCount::Id:
case ThreadNetworkDiagnostics::Attributes::RxErrInvalidSrcAddrCount::Id:
case ThreadNetworkDiagnostics::Attributes::RxErrSecCount::Id:
case ThreadNetworkDiagnostics::Attributes::RxErrFcsCount::Id:
case ThreadNetworkDiagnostics::Attributes::RxErrOtherCount::Id:
case ThreadNetworkDiagnostics::Attributes::ActiveTimestamp::Id:
case ThreadNetworkDiagnostics::Attributes::PendingTimestamp::Id:
case ThreadNetworkDiagnostics::Attributes::Delay::Id:
case ThreadNetworkDiagnostics::Attributes::ChannelPage0Mask::Id:
return WriteThreadNetworkDiagnosticAttributeToTlv(aPath.mAttributeId, aEncoder);
default:
break;
}

return CHIP_NO_ERROR;
}

} // anonymous namespace
Expand Down

0 comments on commit 133e259

Please sign in to comment.