Skip to content

Commit

Permalink
Remove incorrect GenericConnectivityManagerImpl_NoThread<ImplClass>::…
Browse files Browse the repository at this point in the history
…_WriteThreadNetworkDiagnosticAttributeToTlv code. (#20014)

We should not be doing anything other than returning error here:
consumers should not enable Thread network diagnostics while not even
compiling in Thread support in the connectivity manager.  And this
avoids the codesize hit for platforms that in fact do not support
Thread.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jul 5, 2022
1 parent a749f47 commit 1088800
Showing 1 changed file with 1 addition and 163 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,169 +143,7 @@ template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl_NoThread<ImplClass>::_WriteThreadNetworkDiagnosticAttributeToTlv(
AttributeId attributeId, app::AttributeValueEncoder & encoder)
{
CHIP_ERROR err = CHIP_NO_ERROR;

switch (attributeId)
{
case app::Clusters::ThreadNetworkDiagnostics::Attributes::NeighborTableList::Id:
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RouteTableList::Id:
case app::Clusters::ThreadNetworkDiagnostics::Attributes::ActiveNetworkFaultsList::Id:
err = encoder.EncodeEmptyList();
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::Channel::Id:
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RoutingRole::Id:
case app::Clusters::ThreadNetworkDiagnostics::Attributes::NetworkName::Id:
case app::Clusters::ThreadNetworkDiagnostics::Attributes::PanId::Id:
case app::Clusters::ThreadNetworkDiagnostics::Attributes::ExtendedPanId::Id:
case app::Clusters::ThreadNetworkDiagnostics::Attributes::MeshLocalPrefix::Id:
case app::Clusters::ThreadNetworkDiagnostics::Attributes::PartitionId::Id:
case app::Clusters::ThreadNetworkDiagnostics::Attributes::Weighting::Id:
case app::Clusters::ThreadNetworkDiagnostics::Attributes::DataVersion::Id:
case app::Clusters::ThreadNetworkDiagnostics::Attributes::StableDataVersion::Id:
case app::Clusters::ThreadNetworkDiagnostics::Attributes::LeaderRouterId::Id:
case app::Clusters::ThreadNetworkDiagnostics::Attributes::ActiveTimestamp::Id:
case app::Clusters::ThreadNetworkDiagnostics::Attributes::PendingTimestamp::Id:
case app::Clusters::ThreadNetworkDiagnostics::Attributes::Delay::Id:
case app::Clusters::ThreadNetworkDiagnostics::Attributes::ChannelMask::Id:
case app::Clusters::ThreadNetworkDiagnostics::Attributes::SecurityPolicy::Id:
case app::Clusters::ThreadNetworkDiagnostics::Attributes::OperationalDatasetComponents::Id:
err = encoder.EncodeNull();
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::OverrunCount::Id:
err = encoder.Encode(static_cast<uint64_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::DetachedRoleCount::Id:
err = encoder.Encode(static_cast<uint16_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::ChildRoleCount::Id:
err = encoder.Encode(static_cast<uint16_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RouterRoleCount::Id:
err = encoder.Encode(static_cast<uint16_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::LeaderRoleCount::Id:
err = encoder.Encode(static_cast<uint16_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::AttachAttemptCount::Id:
err = encoder.Encode(static_cast<uint16_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::PartitionIdChangeCount::Id:
err = encoder.Encode(static_cast<uint16_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::BetterPartitionAttachAttemptCount::Id:
err = encoder.Encode(static_cast<uint16_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::ParentChangeCount::Id:
err = encoder.Encode(static_cast<uint16_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::TxTotalCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::TxUnicastCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::TxBroadcastCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::TxAckRequestedCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::TxAckedCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::TxNoAckRequestedCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::TxDataCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::TxDataPollCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::TxBeaconCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::TxBeaconRequestCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::TxOtherCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::TxRetryCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::TxDirectMaxRetryExpiryCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::TxIndirectMaxRetryExpiryCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::TxErrCcaCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::TxErrAbortCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::TxErrBusyChannelCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RxTotalCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RxUnicastCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RxBroadcastCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDataCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDataPollCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RxBeaconCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RxBeaconRequestCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RxOtherCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RxAddressFilteredCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDestAddrFilteredCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDuplicatedCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrNoFrameCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrUnknownNeighborCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrInvalidSrcAddrCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrSecCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrFcsCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
case app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrOtherCount::Id:
err = encoder.Encode(static_cast<uint32_t>(0));
break;
default:
err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
break;
}

return err;
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}

} // namespace Internal
Expand Down

0 comments on commit 1088800

Please sign in to comment.