Skip to content

Commit

Permalink
Clear endpoint bitmask before reporting the PartList attribute
Browse files Browse the repository at this point in the history
When we set a low value to the minimum subscription interval for
subscription for the PartList attribute of the Description cluster,
and then remove a dynamic endpoint the related bitmask may change
after reporting it to a controller.
The controller receives the old number of endpoints and does not
update it within the following subscriptions until the next change
of the PartList attribute occurs.

To resolve the issue the endpoint bitmask should be cleared before
reporting the PartList attribute of the Descriptor cluster to avoid
race conditions.
  • Loading branch information
ArekBalysNordic committed Oct 10, 2023
1 parent c534070 commit 46690ff
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/app/util/attribute-storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,7 @@ bool emberAfEndpointEnableDisable(EndpointId endpoint, bool enable)
else
{
shutdownEndpoint(&(emAfEndpoints[index]));
emAfEndpoints[index].bitmask.Clear(EmberAfEndpointOptions::isEnabled);
}

EndpointId parentEndpointId = emberAfParentEndpointFromIndex(index);
Expand All @@ -963,11 +964,6 @@ bool emberAfEndpointEnableDisable(EndpointId endpoint, bool enable)
app::Clusters::Descriptor::Attributes::PartsList::Id);
}

if (!enable)
{
emAfEndpoints[index].bitmask.Clear(EmberAfEndpointOptions::isEnabled);
}

return true;
}

Expand Down

0 comments on commit 46690ff

Please sign in to comment.