Skip to content

Commit

Permalink
Updated Fabric capacity rule to apply less than half of SceneTableSiz…
Browse files Browse the repository at this point in the history
…e and adapted the tests
  • Loading branch information
lpbeliveau-silabs committed Oct 16, 2023
1 parent 65f3ced commit 703709a
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 74 deletions.
2 changes: 1 addition & 1 deletion src/app/clusters/scenes-server/SceneTableImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ void DefaultSceneTableImpl::SetTableSize(uint16_t endpointSceneTableSize)
{
// Verify the endpoint passed size respects the limits of the device configuration
mMaxScenesPerEndpoint = (kMaxScenesPerEndpoint < endpointSceneTableSize) ? kMaxScenesPerEndpoint : endpointSceneTableSize;
mMaxScenesPerFabric = static_cast<uint16_t>(mMaxScenesPerEndpoint / 2);
mMaxScenesPerFabric = static_cast<uint16_t>((mMaxScenesPerEndpoint - 1) / 2);
}

DefaultSceneTableImpl::SceneEntryIterator * DefaultSceneTableImpl::IterateSceneEntries(FabricIndex fabric)
Expand Down
2 changes: 1 addition & 1 deletion src/app/clusters/scenes-server/SceneTableImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
namespace chip {
namespace scenes {

static constexpr uint16_t kMaxScenesPerFabric = MATTER_SCENES_TABLE_SIZE / 2;
static constexpr uint16_t kMaxScenesPerFabric = (MATTER_SCENES_TABLE_SIZE - 1) / 2;
static constexpr uint16_t kMaxScenesPerEndpoint = MATTER_SCENES_TABLE_SIZE;

using clusterId = chip::ClusterId;
Expand Down
Loading

0 comments on commit 703709a

Please sign in to comment.