Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix management of mRunScheduled state in reporting engine. #20694

Merged
merged 1 commit into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/app/reporting/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ CHIP_ERROR Engine::BuildAndSendSingleReportData(ReadHandler * apReadHandler)
void Engine::Run(System::Layer * aSystemLayer, void * apAppState)
{
Engine * const pEngine = reinterpret_cast<Engine *>(apAppState);
pEngine->mRunScheduled = false;
pEngine->Run();
}

Expand Down Expand Up @@ -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();
Expand Down
10 changes: 5 additions & 5 deletions src/app/reporting/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand 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
Expand Down