Skip to content

Commit 902e103

Browse files
ArekBalysNordicpull[bot]
authored andcommittedOct 17, 2023
Clear endpoint bitmask before reporting the PartList attribute (#29673)
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.
1 parent 858bb5c commit 902e103

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed
 

‎src/app/util/attribute-storage.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,7 @@ bool emberAfEndpointEnableDisable(EndpointId endpoint, bool enable)
943943
else
944944
{
945945
shutdownEndpoint(&(emAfEndpoints[index]));
946+
emAfEndpoints[index].bitmask.Clear(EmberAfEndpointOptions::isEnabled);
946947
}
947948

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

966-
if (!enable)
967-
{
968-
emAfEndpoints[index].bitmask.Clear(EmberAfEndpointOptions::isEnabled);
969-
}
970-
971967
return true;
972968
}
973969

0 commit comments

Comments
 (0)