diff --git a/src/app/icd/server/ICDManager.cpp b/src/app/icd/server/ICDManager.cpp index ba349b22b972a5..6efa43875fdf46 100644 --- a/src/app/icd/server/ICDManager.cpp +++ b/src/app/icd/server/ICDManager.cpp @@ -117,13 +117,13 @@ void ICDManager::Shutdown() bool ICDManager::SupportsFeature(Feature feature) { // Can't use attribute accessors/Attributes::FeatureMap::Get in unit tests -#if !CONFIG_BUILD_FOR_HOST_UNIT_TEST +#if !(CONFIG_BUILD_FOR_HOST_UNIT_TEST) uint32_t featureMap = 0; bool success = (Attributes::FeatureMap::Get(kRootEndpointId, &featureMap) == Status::Success); return success ? ((featureMap & to_underlying(feature)) != 0) : false; #else return ((mFeatureMap & to_underlying(feature)) != 0); -#endif // !CONFIG_BUILD_FOR_HOST_UNIT_TEST +#endif // !(CONFIG_BUILD_FOR_HOST_UNIT_TEST) } uint32_t ICDManager::StayActiveRequest(uint32_t stayActiveDuration) @@ -145,7 +145,7 @@ uint32_t ICDManager::StayActiveRequest(uint32_t stayActiveDuration) #if CHIP_CONFIG_ENABLE_ICD_CIP void ICDManager::SendCheckInMsgs() { -#if !CONFIG_BUILD_FOR_HOST_UNIT_TEST +#if !(CONFIG_BUILD_FOR_HOST_UNIT_TEST) VerifyOrDie(mStorage != nullptr); VerifyOrDie(mFabricTable != nullptr); @@ -213,7 +213,7 @@ void ICDManager::SendCheckInMsgs() } } } -#endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST +#endif // !(CONFIG_BUILD_FOR_HOST_UNIT_TEST) } bool ICDManager::CheckInMessagesWouldBeSent(const std::function & shouldCheckInMsgsBeSentFunction) @@ -396,7 +396,7 @@ void ICDManager::UpdateICDMode() ICDConfigurationData::GetInstance().SetICDMode(tempMode); // Can't use attribute accessors/Attributes::OperatingMode::Set in unit tests -#if !CONFIG_BUILD_FOR_HOST_UNIT_TEST +#if !(CONFIG_BUILD_FOR_HOST_UNIT_TEST) Attributes::OperatingMode::Set(kRootEndpointId, static_cast(tempMode)); #endif diff --git a/src/app/icd/server/ICDManager.h b/src/app/icd/server/ICDManager.h index dc516673df8d40..eae0adbc1a28de 100644 --- a/src/app/icd/server/ICDManager.h +++ b/src/app/icd/server/ICDManager.h @@ -233,7 +233,7 @@ class ICDManager : public ICDListener, public TestEventTriggerHandler #if CHIP_CONFIG_PERSIST_SUBSCRIPTIONS && !CHIP_CONFIG_SUBSCRIPTION_TIMEOUT_RESUMPTION bool GetIsBootUpResumeSubscriptionExecuted() { return mIsBootUpResumeSubscriptionExecuted; }; #endif // !CHIP_CONFIG_SUBSCRIPTION_TIMEOUT_RESUMPTION && CHIP_CONFIG_PERSIST_SUBSCRIPTIONS -#endif +#endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST // Implementation of ICDListener functions. // Callers must origin from the chip task context or hold the ChipStack lock. @@ -382,10 +382,10 @@ class ICDManager : public ICDListener, public TestEventTriggerHandler ObjectPool mICDSenderPool; #endif // CHIP_CONFIG_ENABLE_ICD_CIP -#ifdef CONFIG_BUILD_FOR_HOST_UNIT_TEST +#if CONFIG_BUILD_FOR_HOST_UNIT_TEST // feature map that can be changed at runtime for testing purposes uint32_t mFeatureMap = 0; -#endif +#endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST }; } // namespace app diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 3ad401afb3e47a..0eba8fc692d6d8 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -290,7 +290,8 @@ "ActiveModeThreshold", "RegisteredClients", "ICDCounter", - "ClientsSupportedPerFabric" + "ClientsSupportedPerFabric", + "MaximumCheckInBackOff" ], "Occupancy Sensing": ["HoldTimeLimits", "HoldTime", "FeatureMap"], "Operational Credentials": [ diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index c291fc651f6aa0..6907cfea0eb19f 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -284,7 +284,8 @@ "ActiveModeThreshold", "RegisteredClients", "ICDCounter", - "ClientsSupportedPerFabric" + "ClientsSupportedPerFabric", + "MaximumCheckInBackOff" ], "Occupancy Sensing": ["HoldTimeLimits", "HoldTime", "FeatureMap"], "Operational Credentials": [ diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 762cedbf1b5aa3..c23e0e252bbb99 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -9091,53 +9091,6 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters } // namespace OperatingMode -namespace MaximumCheckInBackOff { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::IcdManagement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::IcdManagement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::IcdManagement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); -} - -} // namespace MaximumCheckInBackOff - namespace FeatureMap { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 98aebd50964980..11e2228564e6ab 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -1431,12 +1431,6 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters MarkAttributeDirty markDirty); } // namespace OperatingMode -namespace MaximumCheckInBackOff { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // int32u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); -} // namespace MaximumCheckInBackOff - namespace FeatureMap { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // bitmap32 Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value);