Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix fabric index management in the fabric table. (#16587)
Browse files Browse the repository at this point in the history
* Fix fabric index management in the fabric table.

Before this change, the fabric index for a fabric table entry had to match its offset in the table.  Therefore we only used indices up to CHIP_CONFIG_MAX_FABRICS and then looped back around to index 1.

Furthermore, we did not use to persist our mNextAvailableFabricIndex,
so after a restart would start assigning fabric indices that
corresponded to deleted fabrics, instead of not-yet-used ones, even if
we had not yet exceeded CHIP_CONFIG_MAX_FABRICS total commissioning
events.

This change decouples the fabric index from the table offset.  We now
store the list of fabric indices used and the fabric index we should
use for the next time a fabric is added.

* Fix TestCASESession compilation.

* Address review comments.
bzbarsky-apple authored and pull[bot] committed Jun 23, 2023
1 parent 104169c commit 4682566
Showing 4 changed files with 300 additions and 104 deletions.
Loading

0 comments on commit 4682566

Please sign in to comment.