Matter::FabricTable
Inherits Reference < Object
FabricTable manages the collection of fabrics on a device
Matter devices can be members of multiple fabrics simultaneously (multi-admin). Each fabric represents a separate administrative domain with its own trust root, operational certificates, and access control.
The FabricTable:
- Stores up to a device-specific maximum number of fabrics (typically 16)
- Assigns unique local fabric indices (1-254)
- Persists fabrics to storage
- Provides lookup by fabric_index or fabric_id
- Handles fabric lifecycle (add, update, remove)
Specification: Matter 1.4 ยง 4.13.3 (Fabric Table)
Constants
DEFAULT_MAX_FABRICS = 16_u8
Maximum number of fabrics a device can support Matter spec requires minimum 5, but devices may support more
Log = ::Log.for("matter.fabric_table")
STORAGE_CONTEXT = ["fabrics"]
Storage context for fabric persistence
Constructors
new(storage : Storage::Base, max_fabrics : UInt8 = DEFAULT_MAX_FABRICS)
SourceInstance methods
add_fabric_auto_index(fabric_id : UInt64, node_id : UInt64, root_public_key : Bytes, operational_cert : Bytes, operational_key : Crypto::Key, ipk : Bytes, vendor_id : UInt16 = 65521_u16, label : String = "", intermediate_cert : Bytes | Nil = nil, root_cert : Bytes | Nil = nil) : Fabric | Nil
Add a fabric with automatic index assignment
find_by_fabric_identity(fabric_id : UInt64, root_public_key : Bytes) : Fabric | Nil
Find a fabric by its identity (root_public_key + fabric_id).
mark_fabric_used(fabric_index : UInt8) : Bool
Mark a fabric as recently used (updates last_used_at)