diff --git a/src/app/reporting/Engine.cpp b/src/app/reporting/Engine.cpp index 5e329ccf4e1c4d..702b881c18e031 100644 --- a/src/app/reporting/Engine.cpp +++ b/src/app/reporting/Engine.cpp @@ -539,6 +539,7 @@ CHIP_ERROR Engine::BuildAndSendSingleReportData(ReadHandler * apReadHandler) void Engine::Run(System::Layer * aSystemLayer, void * apAppState) { Engine * const pEngine = reinterpret_cast(apAppState); + pEngine->mRunScheduled = false; pEngine->Run(); } @@ -575,8 +576,6 @@ void Engine::Run() InteractionModelEngine * imEngine = InteractionModelEngine::GetInstance(); - mRunScheduled = false; - // We may be deallocating read handlers as we go. Track how many we had // initially, so we make sure to go through all of them. size_t initialAllocated = imEngine->mReadHandlers.Allocated(); diff --git a/src/app/reporting/Engine.h b/src/app/reporting/Engine.h index b8e8d9abb61a56..cb25b85d0b873b 100644 --- a/src/app/reporting/Engine.h +++ b/src/app/reporting/Engine.h @@ -69,11 +69,6 @@ class Engine void SetMaxAttributesPerChunk(uint32_t aMaxAttributesPerChunk) { mMaxAttributesPerChunk = aMaxAttributesPerChunk; } #endif - /** - * Main work-horse function that executes the run-loop. - */ - void Run(); - /** * Should be invoked when the device receives a Status report, or when the Report data request times out. * This allows the engine to do some clean-up. @@ -131,6 +126,11 @@ class Engine #endif private: + /** + * Main work-horse function that executes the run-loop. + */ + void Run(); + friend class TestReportingEngine; struct AttributePathParamsWithGeneration : public AttributePathParams