Skip to content

Commit fc67454

Browse files
committed
Change RunMode to Idle after cleaning cycle completes
1 parent ec69e2a commit fc67454

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

examples/chef/common/chef-rvc-mode-delegate.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ using ModeTagStructType = chip::app::Clusters::detail::Structs::ModeTagStruct::T
3737
using namespace chip::app::Clusters::RvcRunMode;
3838

3939
static std::unique_ptr<RvcRunModeDelegate> gRvcRunModeDelegate;
40-
static std::unique_ptr<ModeBase::Instance> gRvcRunModeInstance;
40+
std::unique_ptr<ModeBase::Instance> gRvcRunModeInstance;
4141

4242
CHIP_ERROR RvcRunModeDelegate::Init()
4343
{

examples/chef/common/chef-rvc-mode-delegate.h

+3
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ void Shutdown();
122122
} // namespace chip
123123

124124
#ifdef MATTER_DM_PLUGIN_RVC_RUN_MODE_SERVER
125+
extern std::unique_ptr<chip::app::Clusters::ModeBase::Instance> gRvcRunModeInstance;
126+
125127
chip::Protocols::InteractionModel::Status chefRvcRunModeWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
126128
const EmberAfAttributeMetadata * attributeMetadata,
127129
uint8_t * buffer);
@@ -138,3 +140,4 @@ chip::Protocols::InteractionModel::Status chefRvcCleanModeReadCallback(chip::End
138140
const EmberAfAttributeMetadata * attributeMetadata,
139141
uint8_t * buffer, uint16_t maxReadLength);
140142
#endif // MATTER_DM_PLUGIN_RVC_CLEAN_MODE_SERVER
143+

examples/chef/common/chef-rvc-operational-state-delegate.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ using namespace chip::app::Clusters::OperationalState;
2828
using namespace chip::app::Clusters::RvcOperationalState;
2929
using chip::Protocols::InteractionModel::Status;
3030

31+
#ifdef MATTER_DM_PLUGIN_RVC_RUN_MODE_SERVER
32+
#include <chef-rvc-mode-delegate.h>
33+
#endif // MATTER_DM_PLUGIN_RVC_RUN_MODE_SERVER
34+
3135
std::unique_ptr<RvcOperationalStateDelegate> gRvcOperationalStateDelegate;
3236
static std::unique_ptr<RvcOperationalState::Instance> gRvcOperationalStateInstance;
3337

@@ -228,6 +232,10 @@ static void onOperationalStateTimerTick(System::Layer * systemLayer, void * data
228232
gRvcOperationalStateDelegate->mRunningTime = 0;
229233
gRvcOperationalStateDelegate->mPausedTime = 0;
230234
gRvcOperationalStateDelegate->mCountdownTime.SetNull();
235+
236+
#ifdef MATTER_DM_PLUGIN_RVC_RUN_MODE_SERVER
237+
gRvcRunModeInstance->UpdateCurrentMode(RvcRunMode::ModeIdle);
238+
#endif // MATTER_DM_PLUGIN_RVC_RUN_MODE_SERVER
231239
}
232240
}
233241
}

0 commit comments

Comments
 (0)