16
16
*/
17
17
#pragma once
18
18
19
- #include < app-common/zap-generated/cluster-enums.h>
20
-
21
19
#include < app/icd/server/ICDServerConfig.h>
22
20
23
- #if CHIP_CONFIG_ENABLE_ICD_CIP
24
- #include < app/icd/server/ICDCheckInSender.h> // nogncheck
25
- #include < app/icd/server/ICDMonitoringTable.h> // nogncheck
26
- #endif // CHIP_CONFIG_ENABLE_ICD_CIP
27
-
21
+ #include < app-common/zap-generated/cluster-enums.h>
28
22
#include < app/SubscriptionsInfoProvider.h>
23
+ #include < app/TestEventTriggerDelegate.h>
29
24
#include < app/icd/server/ICDConfigurationData.h>
30
25
#include < app/icd/server/ICDNotifier.h>
31
26
#include < app/icd/server/ICDStateObserver.h>
37
32
#include < platform/internal/CHIPDeviceLayerInternal.h>
38
33
#include < system/SystemClock.h>
39
34
35
+ #if CHIP_CONFIG_ENABLE_ICD_CIP
36
+ #include < app/icd/server/ICDCheckInSender.h> // nogncheck
37
+ #include < app/icd/server/ICDMonitoringTable.h> // nogncheck
38
+ #endif // CHIP_CONFIG_ENABLE_ICD_CIP
39
+
40
40
namespace chip {
41
41
namespace Crypto {
42
42
using SymmetricKeystore = SessionKeystore;
@@ -53,7 +53,7 @@ class TestICDManager;
53
53
/* *
54
54
* @brief ICD Manager is responsible of processing the events and triggering the correct action for an ICD
55
55
*/
56
- class ICDManager : public ICDListener
56
+ class ICDManager : public ICDListener , public TestEventTriggerHandler
57
57
{
58
58
public:
59
59
// This structure is used for the creation an ObjectPool of ICDStateObserver pointers
@@ -81,8 +81,9 @@ class ICDManager : public ICDListener
81
81
82
82
ICDManager () {}
83
83
void Init (PersistentStorageDelegate * storage, FabricTable * fabricTable, Crypto::SymmetricKeystore * symmetricKeyStore,
84
- Messaging::ExchangeManager * exchangeManager, SubscriptionsInfoProvider * manager);
85
- void Shutdown ();
84
+ Messaging::ExchangeManager * exchangeManager, SubscriptionsInfoProvider * manager,
85
+ TestEventTriggerDelegate * testEventTriggerDelegate);
86
+ void Shutdown (TestEventTriggerDelegate * testEventTriggerDelegate);
86
87
void UpdateICDMode ();
87
88
void UpdateOperationState (OperationalState state);
88
89
void SetKeepActiveModeRequirements (KeepActiveFlags flag, bool state);
@@ -117,6 +118,15 @@ class ICDManager : public ICDListener
117
118
*/
118
119
uint32_t StayActiveRequest (uint32_t stayActiveDuration);
119
120
121
+ /* *
122
+ * @brief TestEventTriggerHandler for the ICD feature set
123
+ *
124
+ * @param eventTrigger Event trigger to handle.
125
+ * @return CHIP_ERROR CHIP_NO_ERROR - No erros during the processing
126
+ * CHIP_ERROR_INVALID_ARGUMENT - eventTrigger isn't a valid value
127
+ */
128
+ CHIP_ERROR HandleEventTrigger (uint64_t eventTrigger) override ;
129
+
120
130
#if CHIP_CONFIG_ENABLE_ICD_CIP
121
131
void SendCheckInMsgs ();
122
132
@@ -139,14 +149,14 @@ class ICDManager : public ICDListener
139
149
void OnSubscriptionReport () override ;
140
150
141
151
protected:
152
+ friend class TestICDManager ;
153
+
142
154
/* *
143
155
* @brief Hepler function that extends the Active Mode duration as well as the Active Mode Jitter timer for the transition to
144
156
* iddle mode.
145
157
*/
146
158
void ExtendActiveMode (System::Clock::Milliseconds16 extendDuration);
147
159
148
- friend class TestICDManager ;
149
-
150
160
static void OnIdleModeDone (System::Layer * aLayer, void * appState);
151
161
static void OnActiveModeDone (System::Layer * aLayer, void * appState);
152
162
@@ -165,13 +175,23 @@ class ICDManager : public ICDListener
165
175
uint8_t mOpenExchangeContextCount = 0 ;
166
176
167
177
private:
178
+ enum class ICDTestEventTriggerEvent : uint64_t
179
+ {
180
+ kForceToActiveMode = 0x0046'0000'00000001 ,
181
+ kForceToIdleMode = 0x0046'0000'00000002 ,
182
+ kAddActiveModeReq = 0x0046'0000'00000003 ,
183
+ kRemoveActiveModeReq = 0x0046'0000'00000004 ,
184
+ kDoubleICDCounterValue = 0x0046'0000'00000005 ,
185
+ kInvalidateICDCounter = 0x0046'0000'00000006 ,
186
+ };
187
+
168
188
#if CHIP_CONFIG_ENABLE_ICD_CIP
169
189
/* *
170
190
* @brief Function checks if at least one client registration would require a Check-In message
171
191
*
172
192
* @return true At least one registration would require an Check-In message if we were entering ActiveMode.
173
- * @return false None of the registration would require a Check-In message either because there are no registration or because
174
- * they all have associated subscriptions.
193
+ * @return false None of the registration would require a Check-In message either because there are no registration or
194
+ * because they all have associated subscriptions.
175
195
*/
176
196
bool CheckInMessagesWouldBeSent ();
177
197
#endif // CHIP_CONFIG_ENABLE_ICD_CIP
0 commit comments