Skip to content

Commit fd2d000

Browse files
[ICD] Set MaximumCheckInBackOff to external and fix define guards for unit test members (project-chip#36223) (project-chip#36231)
* Fix ICD manager and attributes * Generated files * zap regen
1 parent 09b7d4b commit fd2d000

File tree

6 files changed

+12
-63
lines changed

6 files changed

+12
-63
lines changed

src/app/icd/server/ICDManager.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ void ICDManager::Shutdown()
117117
bool ICDManager::SupportsFeature(Feature feature)
118118
{
119119
// Can't use attribute accessors/Attributes::FeatureMap::Get in unit tests
120-
#if !CONFIG_BUILD_FOR_HOST_UNIT_TEST
120+
#if !(CONFIG_BUILD_FOR_HOST_UNIT_TEST)
121121
uint32_t featureMap = 0;
122122
bool success = (Attributes::FeatureMap::Get(kRootEndpointId, &featureMap) == Status::Success);
123123
return success ? ((featureMap & to_underlying(feature)) != 0) : false;
124124
#else
125125
return ((mFeatureMap & to_underlying(feature)) != 0);
126-
#endif // !CONFIG_BUILD_FOR_HOST_UNIT_TEST
126+
#endif // !(CONFIG_BUILD_FOR_HOST_UNIT_TEST)
127127
}
128128

129129
uint32_t ICDManager::StayActiveRequest(uint32_t stayActiveDuration)
@@ -145,7 +145,7 @@ uint32_t ICDManager::StayActiveRequest(uint32_t stayActiveDuration)
145145
#if CHIP_CONFIG_ENABLE_ICD_CIP
146146
void ICDManager::SendCheckInMsgs()
147147
{
148-
#if !CONFIG_BUILD_FOR_HOST_UNIT_TEST
148+
#if !(CONFIG_BUILD_FOR_HOST_UNIT_TEST)
149149
VerifyOrDie(mStorage != nullptr);
150150
VerifyOrDie(mFabricTable != nullptr);
151151

@@ -213,7 +213,7 @@ void ICDManager::SendCheckInMsgs()
213213
}
214214
}
215215
}
216-
#endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST
216+
#endif // !(CONFIG_BUILD_FOR_HOST_UNIT_TEST)
217217
}
218218

219219
bool ICDManager::CheckInMessagesWouldBeSent(const std::function<ShouldCheckInMsgsBeSentFunction> & shouldCheckInMsgsBeSentFunction)
@@ -396,7 +396,7 @@ void ICDManager::UpdateICDMode()
396396
ICDConfigurationData::GetInstance().SetICDMode(tempMode);
397397

398398
// Can't use attribute accessors/Attributes::OperatingMode::Set in unit tests
399-
#if !CONFIG_BUILD_FOR_HOST_UNIT_TEST
399+
#if !(CONFIG_BUILD_FOR_HOST_UNIT_TEST)
400400
Attributes::OperatingMode::Set(kRootEndpointId, static_cast<OperatingModeEnum>(tempMode));
401401
#endif
402402

src/app/icd/server/ICDManager.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ class ICDManager : public ICDListener, public TestEventTriggerHandler
233233
#if CHIP_CONFIG_PERSIST_SUBSCRIPTIONS && !CHIP_CONFIG_SUBSCRIPTION_TIMEOUT_RESUMPTION
234234
bool GetIsBootUpResumeSubscriptionExecuted() { return mIsBootUpResumeSubscriptionExecuted; };
235235
#endif // !CHIP_CONFIG_SUBSCRIPTION_TIMEOUT_RESUMPTION && CHIP_CONFIG_PERSIST_SUBSCRIPTIONS
236-
#endif
236+
#endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST
237237

238238
// Implementation of ICDListener functions.
239239
// Callers must origin from the chip task context or hold the ChipStack lock.
@@ -382,10 +382,10 @@ class ICDManager : public ICDListener, public TestEventTriggerHandler
382382
ObjectPool<ICDCheckInSender, (CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC * CHIP_CONFIG_MAX_FABRICS)> mICDSenderPool;
383383
#endif // CHIP_CONFIG_ENABLE_ICD_CIP
384384

385-
#ifdef CONFIG_BUILD_FOR_HOST_UNIT_TEST
385+
#if CONFIG_BUILD_FOR_HOST_UNIT_TEST
386386
// feature map that can be changed at runtime for testing purposes
387387
uint32_t mFeatureMap = 0;
388-
#endif
388+
#endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST
389389
};
390390

391391
} // namespace app

src/app/zap-templates/zcl/zcl-with-test-extensions.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@
287287
"ActiveModeThreshold",
288288
"RegisteredClients",
289289
"ICDCounter",
290-
"ClientsSupportedPerFabric"
290+
"ClientsSupportedPerFabric",
291+
"MaximumCheckInBackOff"
291292
],
292293
"Occupancy Sensing": ["HoldTimeLimits", "HoldTime", "FeatureMap"],
293294
"Operational Credentials": [

src/app/zap-templates/zcl/zcl.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@
281281
"ActiveModeThreshold",
282282
"RegisteredClients",
283283
"ICDCounter",
284-
"ClientsSupportedPerFabric"
284+
"ClientsSupportedPerFabric",
285+
"MaximumCheckInBackOff"
285286
],
286287
"Occupancy Sensing": ["HoldTimeLimits", "HoldTime", "FeatureMap"],
287288
"Operational Credentials": [

zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp

-47
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)