Skip to content

Commit

Permalink
Fix ICD manager and attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs committed Oct 23, 2024
1 parent 197f698 commit 01ec26b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/app/icd/server/ICDManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ 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 !(defined(CONFIG_BUILD_FOR_HOST_UNIT_TEST) && 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;
Expand Down Expand Up @@ -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 !(defined(CONFIG_BUILD_FOR_HOST_UNIT_TEST) && CONFIG_BUILD_FOR_HOST_UNIT_TEST)
VerifyOrDie(mStorage != nullptr);
VerifyOrDie(mFabricTable != nullptr);

Expand Down Expand Up @@ -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 !(defined(CONFIG_BUILD_FOR_HOST_UNIT_TEST) && CONFIG_BUILD_FOR_HOST_UNIT_TEST)
Attributes::OperatingMode::Set(kRootEndpointId, static_cast<OperatingModeEnum>(tempMode));
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/app/icd/server/ICDManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ class ICDManager : public ICDListener, public TestEventTriggerHandler
ObjectPool<ICDCheckInSender, (CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC * CHIP_CONFIG_MAX_FABRICS)> mICDSenderPool;
#endif // CHIP_CONFIG_ENABLE_ICD_CIP

#ifdef CONFIG_BUILD_FOR_HOST_UNIT_TEST
#if defined(CONFIG_BUILD_FOR_HOST_UNIT_TEST) && CONFIG_BUILD_FOR_HOST_UNIT_TEST
// feature map that can be changed at runtime for testing purposes
uint32_t mFeatureMap = 0;
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/app/zap-templates/zcl/zcl-with-test-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@
"ActiveModeThreshold",
"RegisteredClients",
"ICDCounter",
"ClientsSupportedPerFabric"
"ClientsSupportedPerFabric",
"MaximumCheckInBackOff"
],
"Occupancy Sensing": ["HoldTimeLimits", "HoldTime", "FeatureMap"],
"Operational Credentials": [
Expand Down
3 changes: 2 additions & 1 deletion src/app/zap-templates/zcl/zcl.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@
"ActiveModeThreshold",
"RegisteredClients",
"ICDCounter",
"ClientsSupportedPerFabric"
"ClientsSupportedPerFabric",
"MaximumCheckInBackOff"
],
"Occupancy Sensing": ["HoldTimeLimits", "HoldTime", "FeatureMap"],
"Operational Credentials": [
Expand Down

0 comments on commit 01ec26b

Please sign in to comment.