class
Matter::Cluster::GeneralCommissioningCluster
Overview
General Commissioning Cluster (0x0030)
Provides commands and attributes to support the device commissioning process. This includes commissioning window management, failsafe timer management, regulatory configuration, and commissioning completion.
Matter Core Spec §11.9 - General Commissioning Cluster
Defined in:
matter/cluster/general_commissioning_cluster.crConstant Summary
-
ATTR_BASIC_COMMISSIONING_INFO =
1_u32 -
ATTR_BREADCRUMB =
0_u32 -
ATTR_IS_COMMISSIONING_WITHOUT_POWER =
12_u32 -
ATTR_LOCATION_CAPABILITY =
3_u32 -
ATTR_REGULATORY_CONFIG =
2_u32 -
ATTR_SUPPORTS_CONCURRENT_CONNECTION =
4_u32 -
CLUSTER_ID =
48_u32 -
CMD_ARM_FAIL_SAFE =
0_u32 -
CMD_ARM_FAIL_SAFE_RESPONSE =
1_u32 -
CMD_COMMISSIONING_COMPLETE =
4_u32 -
CMD_COMMISSIONING_COMPLETE_RESPONSE =
5_u32 -
CMD_SET_REGULATORY_CONFIG =
2_u32 -
CMD_SET_REGULATORY_CONFIG_RESPONSE =
3_u32 -
Log =
::Log.for("matter.cluster.general_commissioning")
Constructors
Class Method Summary
-
.cluster_id
General Commissioning Cluster (0x0030)
Instance Method Summary
-
#accept_terms_conditions : Nil
Accept Terms & Conditions (for TC feature)
-
#arm_fail_safe(expiry_seconds : UInt16) : Nil
Simple arm failsafe method for tests (arms with default max cumulative)
-
#arm_failsafe(request : ArmFailSafeRequest, session_fabric_index : UInt8 | Nil, is_pase_session : Bool) : ArmFailSafeResponse
Handle ArmFailSafe command
-
#attributes : Array(AttributeMetadata)
Get all attribute metadata
-
#basic_commissioning_info : BasicCommissioningInfo
Get basic commissioning info (for BasicCommissioningInfo attribute)
-
#breadcrumb : UInt64
Breadcrumb attribute (0x0000) - progress tracking during commissioning
-
#breadcrumb=(breadcrumb : UInt64)
Breadcrumb attribute (0x0000) - progress tracking during commissioning
-
#close_commissioning_window : Nil
Close commissioning window
-
#commands : Array(CommandMetadata)
Get all command metadata
-
#commissioning_complete(session_fabric_index : UInt8 | Nil, is_case_session : Bool) : CommissioningCompleteResponse
Handle CommissioningComplete command
-
#country_code : String
Country code (stored for rollback purposes)
-
#country_code=(country_code : String)
Country code (stored for rollback purposes)
-
#country_code_whitelist : Array(String) | Nil
Country code whitelist (nil = all countries allowed)
-
#country_code_whitelist=(country_code_whitelist : Array(String) | Nil)
Country code whitelist (nil = all countries allowed)
-
#disarm_fail_safe : Nil
Disarm the failsafe
- #fabric_index : UInt8 | Nil
- #fabric_index=(fabric_index : UInt8 | Nil)
-
#fail_safe_active : Bool
Alias for backward compatibility
-
#fail_safe_expiry_time : Time | Nil
Get failsafe expiry time (when it will expire)
-
#failsafe_armed? : Bool
Check if failsafe is currently armed
-
#failsafe_context : FailsafeContext | Nil
Get current failsafe context (for testing/inspection)
-
#is_case_session : Bool
Session context properties (set by base class invoke_command via responds_to?) These are populated automatically when commands are invoked through the cluster base class
-
#is_case_session=(is_case_session : Bool)
Session context properties (set by base class invoke_command via responds_to?) These are populated automatically when commands are invoked through the cluster base class
-
#is_fail_safe_expired? : Bool
Check if failsafe is expired
-
#location_capability : RegulatoryLocationType
LocationCapability attribute (0x0003) - supported regulatory locations
-
#location_capability=(location_capability : RegulatoryLocationType)
LocationCapability attribute (0x0003) - supported regulatory locations
-
#max_cumulative_failsafe_seconds : UInt16
BasicCommissioningInfo attribute (0x0001) Contains MaxCumulativeFailsafeSeconds and MaxNetworkCommissioningSeconds
-
#max_cumulative_failsafe_seconds=(max_cumulative_failsafe_seconds : UInt16)
BasicCommissioningInfo attribute (0x0001) Contains MaxCumulativeFailsafeSeconds and MaxNetworkCommissioningSeconds
- #max_network_commissioning_seconds : UInt16
- #max_network_commissioning_seconds=(max_network_commissioning_seconds : UInt16)
-
#name : String
Get cluster name
-
#on_check_terms_conditions : Proc(Bool) | Nil
Callback to check if Terms & Conditions have been accepted
-
#on_check_terms_conditions=(on_check_terms_conditions : Proc(Bool) | Nil)
Callback to check if Terms & Conditions have been accepted
-
#on_clear_pase_sessions : Proc(Nil) | Nil
Callback to clear all PASE sessions after successful commissioning
-
#on_clear_pase_sessions=(on_clear_pase_sessions : Proc(Nil) | Nil)
Callback to clear all PASE sessions after successful commissioning
-
#on_failsafe_armed : Proc(Nil) | Nil
Callback to reset OperationalCredentials failsafe context when a new failsafe is armed This is necessary because the OperationalCredentials cluster has its own failsafe state tracking (noc_added_or_updated, etc.) that must be reset for each new commissioning session
-
#on_failsafe_armed=(on_failsafe_armed : Proc(Nil) | Nil)
Callback to reset OperationalCredentials failsafe context when a new failsafe is armed This is necessary because the OperationalCredentials cluster has its own failsafe state tracking (noc_added_or_updated, etc.) that must be reset for each new commissioning session
-
#on_persist_fabric_table : Proc(Nil) | Nil
Callback to persist the fabric table after successful commissioning
-
#on_persist_fabric_table=(on_persist_fabric_table : Proc(Nil) | Nil)
Callback to persist the fabric table after successful commissioning
-
#open_commissioning_window : Nil
Open commissioning window (allows PASE sessions)
-
#read_attribute(attribute_id : UInt32, fabric_index : UInt8 | Nil = nil) : InteractionModel::Status | Bytes
Read an attribute value The fabric_index parameter is optional and used for fabric-scoped attributes like CurrentFabricIndex in OperationalCredentialsCluster
-
#record_added_fabric(fabric_index : UInt8) : Nil
Record that a fabric was added during this failsafe context
-
#regulatory_config : RegulatoryLocationType
RegulatoryConfig attribute (0x0002) - current regulatory location
-
#regulatory_config=(regulatory_config : RegulatoryLocationType)
RegulatoryConfig attribute (0x0002) - current regulatory location
-
#restore_regulatory_config(location_type : UInt8, country_code : String) : Nil
Restore regulatory config from snapshot (called during rollback)
-
#set_regulatory_config(request : SetRegulatoryConfigRequest) : SetRegulatoryConfigResponse
Handle SetRegulatoryConfig command
-
#supports_concurrent_connection : Bool
SupportsConcurrentConnection attribute (0x0004)
-
#supports_concurrent_connection=(supports_concurrent_connection : Bool)
SupportsConcurrentConnection attribute (0x0004)
-
#terms_conditions_accepted? : Bool
Check if Terms & Conditions are accepted
-
#terms_conditions_required : Bool
Terms & Conditions feature support
-
#terms_conditions_required=(terms_conditions_required : Bool)
Terms & Conditions feature support
-
#write_attribute(attribute_id : UInt32, value : Bytes) : InteractionModel::Status
Write an attribute value
Instance methods inherited from class Matter::Cluster::Base
attributes : Array(AttributeMetadata)
attributes,
cluster_id : DataType::ClusterId
cluster_id,
cluster_id=(cluster_id : DataType::ClusterId)
cluster_id=,
commands : Array(CommandMetadata)
commands,
data_version : UInt32
data_version,
data_version=(data_version : UInt32)
data_version=,
endpoint_id : DataType::EndpointNumber
endpoint_id,
endpoint_id=(endpoint_id : DataType::EndpointNumber)
endpoint_id=,
events : Array(EventMetadata)
events,
get_attribute_metadata(attribute_id : UInt32) : AttributeMetadata | Nil
get_attribute_metadata,
get_command_metadata(command_id : UInt32) : CommandMetadata | Nil
get_command_metadata,
invoke_command(command_id : UInt32, fields : Bytes = Bytes.new(0), session_id : UInt64 | Nil = nil, is_case_session : Bool = false, fabric_index : UInt8 | Nil = nil) : InteractionModel::Status | CommandResponse
invoke_command,
name : String
name,
on_attribute_changed : Proc(UInt16, UInt32, UInt32, Nil) | Nil
on_attribute_changed,
on_attribute_changed=(on_attribute_changed : Proc(UInt16, UInt32, UInt32, Nil) | Nil)
on_attribute_changed=,
read_attribute(attribute_id : UInt32, fabric_index : UInt8 | Nil = nil) : InteractionModel::Status | Bytes
read_attribute,
write_attribute(attribute_id : UInt32, value : Bytes) : InteractionModel::Status
write_attribute
Constructor methods inherited from class Matter::Cluster::Base
new(endpoint_id : DataType::EndpointNumber, cluster_id : DataType::ClusterId)
new
Constructor Detail
Class Method Detail
General Commissioning Cluster (0x0030)
Provides commands and attributes to support the device commissioning process. This includes commissioning window management, failsafe timer management, regulatory configuration, and commissioning completion.
Matter Core Spec §11.9 - General Commissioning Cluster
Instance Method Detail
Accept Terms & Conditions (for TC feature)
This method is used when the Terms & Conditions feature is enabled to mark that the user has accepted the terms.
Simple arm failsafe method for tests (arms with default max cumulative)
Handle ArmFailSafe command
Arms or re-arms the failsafe timer. The failsafe timer ensures that commissioning changes are rolled back if commissioning doesn't complete successfully.
@param request ArmFailSafe request with expiry length and breadcrumb @param session_fabric_index Fabric index of requesting session (nil for PASE) @param is_pase_session Whether this is a PASE session @return ArmFailSafe response with status
Get all attribute metadata
Get basic commissioning info (for BasicCommissioningInfo attribute)
Breadcrumb attribute (0x0000) - progress tracking during commissioning
Get all command metadata
Handle CommissioningComplete command
Signals that commissioning is complete. This validates that all required commissioning steps have been performed, then disarms the failsafe and persists the commissioned state.
@param session_fabric_index Fabric index of requesting session @param is_case_session Whether this is a CASE session (required) @return CommissioningComplete response with status
Country code whitelist (nil = all countries allowed)
Country code whitelist (nil = all countries allowed)
Get current failsafe context (for testing/inspection)
Session context properties (set by base class invoke_command via responds_to?) These are populated automatically when commands are invoked through the cluster base class
Session context properties (set by base class invoke_command via responds_to?) These are populated automatically when commands are invoked through the cluster base class
LocationCapability attribute (0x0003) - supported regulatory locations
LocationCapability attribute (0x0003) - supported regulatory locations
BasicCommissioningInfo attribute (0x0001) Contains MaxCumulativeFailsafeSeconds and MaxNetworkCommissioningSeconds
BasicCommissioningInfo attribute (0x0001) Contains MaxCumulativeFailsafeSeconds and MaxNetworkCommissioningSeconds
Callback to check if Terms & Conditions have been accepted
Callback to check if Terms & Conditions have been accepted
Callback to clear all PASE sessions after successful commissioning
Callback to clear all PASE sessions after successful commissioning
Callback to reset OperationalCredentials failsafe context when a new failsafe is armed This is necessary because the OperationalCredentials cluster has its own failsafe state tracking (noc_added_or_updated, etc.) that must be reset for each new commissioning session
Callback to reset OperationalCredentials failsafe context when a new failsafe is armed This is necessary because the OperationalCredentials cluster has its own failsafe state tracking (noc_added_or_updated, etc.) that must be reset for each new commissioning session
Callback to persist the fabric table after successful commissioning
Callback to persist the fabric table after successful commissioning
Read an attribute value The fabric_index parameter is optional and used for fabric-scoped attributes like CurrentFabricIndex in OperationalCredentialsCluster
Record that a fabric was added during this failsafe context
This should be called by OperationalCredentialsCluster when AddNOC succeeds. It updates the failsafe context so that CommissioningComplete can be called from a CASE session on the new fabric (PASE→CASE transition).
@param fabric_index The index of the newly added fabric
RegulatoryConfig attribute (0x0002) - current regulatory location
RegulatoryConfig attribute (0x0002) - current regulatory location
Restore regulatory config from snapshot (called during rollback)
This is called by FailsafeContext#rollback to restore the previous regulatory configuration when a failsafe expires.
@param location_type Previous regulatory location type value @param country_code Previous country code
Handle SetRegulatoryConfig command
Sets the regulatory configuration (indoor/outdoor) and country code.
@param request SetRegulatoryConfig request @return SetRegulatoryConfig response with status
SupportsConcurrentConnection attribute (0x0004)
Terms & Conditions feature support
Write an attribute value