Skip to content

Commit 03cafe0

Browse files
move enum to the impl anonymous namespace
1 parent d0f8957 commit 03cafe0

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

src/app/icd/server/ICDManager.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@
2828
#include <platform/internal/CHIPDeviceLayerInternal.h>
2929
#include <stdlib.h>
3030

31+
namespace {
32+
enum class ICDTestEventTriggerEvent : uint64_t
33+
{
34+
kAddActiveModeReq = 0x0046'0000'00000001,
35+
kRemoveActiveModeReq = 0x0046'0000'00000002,
36+
};
37+
} // namespace
38+
3139
namespace chip {
3240
namespace app {
3341

src/app/icd/server/ICDManager.h

-6
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,6 @@ class ICDManager : public ICDListener, public TestEventTriggerHandler
200200
uint8_t mOpenExchangeContextCount = 0;
201201

202202
private:
203-
enum class ICDTestEventTriggerEvent : uint64_t
204-
{
205-
kAddActiveModeReq = 0x0046'0000'00000001,
206-
kRemoveActiveModeReq = 0x0046'0000'00000002,
207-
};
208-
209203
#if CHIP_CONFIG_ENABLE_ICD_CIP
210204
bool ShouldCheckInMsgsBeSentAtActiveModeFunction(FabricIndex aFabricIndex, NodeId subjectID);
211205

src/app/tests/TestICDManager.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ constexpr uint8_t kKeyBuffer2b[] = {
6767
0xf2, 0xe2, 0xd2, 0xc2, 0xb2, 0xa2, 0x92, 0x82, 0x72, 0x62, 0x52, 0x42, 0x32, 0x22, 0x12, 0x02
6868
};
6969

70+
// Taken from the ICDManager Implementation
71+
enum class ICDTestEventTriggerEvent : uint64_t
72+
{
73+
kAddActiveModeReq = 0x0046'0000'00000001,
74+
kRemoveActiveModeReq = 0x0046'0000'00000002,
75+
};
76+
7077
class TestICDStateObserver : public app::ICDStateObserver
7178
{
7279
public:
@@ -703,15 +710,15 @@ class TestICDManager
703710
NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::IdleMode);
704711

705712
// Add ActiveMode req for the Test event trigger event
706-
ctx->mICDManager.HandleEventTrigger(static_cast<uint64_t>(ICDManager::ICDTestEventTriggerEvent::kAddActiveModeReq));
713+
ctx->mICDManager.HandleEventTrigger(static_cast<uint64_t>(ICDTestEventTriggerEvent::kAddActiveModeReq));
707714
NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode);
708715

709716
// Advance clock by the ActiveModeDuration and check that the device is still in ActiveMode
710717
AdvanceClockAndRunEventLoop(ctx, ICDConfigurationData::GetInstance().GetActiveModeDuration() + 1_ms32);
711718
NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode);
712719

713720
// Remove req and device should go to IdleMode
714-
ctx->mICDManager.HandleEventTrigger(static_cast<uint64_t>(ICDManager::ICDTestEventTriggerEvent::kRemoveActiveModeReq));
721+
ctx->mICDManager.HandleEventTrigger(static_cast<uint64_t>(ICDTestEventTriggerEvent::kRemoveActiveModeReq));
715722
NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::IdleMode);
716723
}
717724
};

0 commit comments

Comments
 (0)