@@ -462,28 +462,27 @@ void ClusterStateCacheT<CanEnableDataCaching>::OnEventData(const EventHeader & a
462
462
mCallback .OnEventData (aEventHeader, apData ? &dataSnapshot : nullptr , apStatus);
463
463
}
464
464
465
- template <bool CanEnableDataCaching >
466
- CHIP_ERROR ClusterStateCacheT<CanEnableDataCaching >::GetStatus(const ConcreteAttributePath & path, StatusIB & status) const
465
+ template <>
466
+ CHIP_ERROR ClusterStateCacheT<true >::GetStatus(const ConcreteAttributePath & path, StatusIB & status) const
467
467
{
468
- if constexpr (CanEnableDataCaching)
469
- {
470
- CHIP_ERROR err;
471
-
472
- auto attributeState = GetAttributeState (path.mEndpointId , path.mClusterId , path.mAttributeId , err);
473
- ReturnErrorOnFailure (err);
468
+ CHIP_ERROR err;
474
469
475
- if (!attributeState->template Is <StatusIB>())
476
- {
477
- return CHIP_ERROR_INVALID_ARGUMENT;
478
- }
470
+ auto attributeState = GetAttributeState (path.mEndpointId , path.mClusterId , path.mAttributeId , err);
471
+ ReturnErrorOnFailure (err);
479
472
480
- status = attributeState->template Get <StatusIB>();
481
- return CHIP_NO_ERROR;
482
- }
483
- else
473
+ if (!attributeState->template Is <StatusIB>())
484
474
{
485
475
return CHIP_ERROR_INVALID_ARGUMENT;
486
476
}
477
+
478
+ status = attributeState->template Get <StatusIB>();
479
+ return CHIP_NO_ERROR;
480
+ }
481
+
482
+ template <>
483
+ CHIP_ERROR ClusterStateCacheT<false >::GetStatus(const ConcreteAttributePath & path, StatusIB & status) const
484
+ {
485
+ return CHIP_ERROR_INVALID_ARGUMENT;
487
486
}
488
487
489
488
template <bool CanEnableDataCaching>
0 commit comments