Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ICD] Set MaximumCheckInBackOff to external and fix define guards for… #36231

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/app/icd/server/ICDManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);

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

Expand Down
6 changes: 3 additions & 3 deletions src/app/icd/server/ICDManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -382,10 +382,10 @@ 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 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
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 @@ -287,7 +287,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 @@ -281,7 +281,8 @@
"ActiveModeThreshold",
"RegisteredClients",
"ICDCounter",
"ClientsSupportedPerFabric"
"ClientsSupportedPerFabric",
"MaximumCheckInBackOff"
],
"Occupancy Sensing": ["HoldTimeLimits", "HoldTime", "FeatureMap"],
"Operational Credentials": [
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading