Skip to content

Commit

Permalink
fix: shutdown calls UnregisterEndpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
rochaferraz committed Sep 11, 2023
1 parent 9a865fd commit 8d4ef76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/clusters/sample-mei-server/sample-mei-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ void MatterSampleMeiPluginServerInitCallback()

void MatterSampleMeiClusterServerShutdownCallback(chip::EndpointId endpoint)
{
// There's currently no whole-cluster shutdown callback. That would trigger
// call to `Shutdown`. Thus ep-based shutdown calls `UnregisterEndpoint`
sampleMeiServer.UnregisterEndpoint(endpoint);
}

Expand Down
3 changes: 3 additions & 0 deletions src/app/clusters/sample-mei-server/sample-mei-server.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ class SampleMeiServer : public AttributeAccessInterface, public CommandHandlerIn
CommandHandlerInterface(Optional<EndpointId>(), Id)
{}
static SampleMeiServer & Instance();

// Currently not used, but should be called from a whole-cluster shutdown
// callback once cluster lifecycle is clearer
void Shutdown();

// Attributes
Expand Down

0 comments on commit 8d4ef76

Please sign in to comment.