class Matter::FabricManager

Overview

FabricManager provides high-level fabric management operations

This class wraps FabricTable and adds additional functionality needed for commissioning operations, including:

Matter Core Spec ยง11.17 - Operational Credentials Cluster

Defined in:

matter/fabric_manager.cr

Constant Summary

Log = ::Log.for("matter.fabric_manager")

Constructors

Instance Method Summary

Constructor Detail

def self.new(fabric_table : FabricTable) #

[View source]

Instance Method Detail

def add_fabric(fabric : Fabric) : Bool #

Add a new fabric


[View source]
def all_fabrics : Array(Fabric) #

Get all fabrics


[View source]
def empty? : Bool #

Check if table is empty


[View source]
def fabric_descriptors : Array(FabricDescriptor) #

Get fabric descriptors for Operational Credentials cluster


[View source]
def fabric_table : FabricTable #

Underlying fabric table


[View source]
def fabric_table=(fabric_table : FabricTable) #

Underlying fabric table


[View source]
def full? : Bool #

Check if table is full


[View source]
def get_fabric(fabric_index : UInt8) : Fabric | Nil #

Get a fabric by index


[View source]
def mark_fabric_used(fabric_index : UInt8) : Bool #

Mark a fabric as recently used


[View source]
def remove_fabric(fabric_index : UInt8) : Bool #

Remove a fabric by fabric index

This is used during failsafe rollback to remove fabrics added during the commissioning session.

@param fabric_index Fabric index to remove (1-254) @return True if fabric was removed, false if not found


[View source]
def restore_noc(fabric_index : UInt8, operational_cert : Bytes, operational_key_bytes : Bytes) : Bool #

Restore NOC (operational certificate and key) for a fabric

This is used during failsafe rollback to revert UpdateNOC changes. The method restores the previous operational certificate and private key for a fabric that was updated during commissioning.

@param fabric_index Fabric index to restore @param operational_cert Previous operational certificate (TLV-encoded) @param operational_key_bytes Previous operational private key bytes @return True if NOC was restored, false if fabric not found


[View source]
def size : Int32 #

Get fabric count


[View source]
def update_fabric(fabric : Fabric) : Bool #

Update an existing fabric


[View source]