class

Matter::Cluster::GeneralCommissioningCluster

Inherits Matter::Cluster::Base < Reference < Object

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

Constants

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

new(endpoint_id : DataType::EndpointNumber = DataType::EndpointNumber.new(0_u16))
Source

Class methods

cluster_id

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

Source

Instance methods

accept_terms_conditions

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.

Source
arm_fail_safe(expiry_seconds : UInt16) : Nil

Simple arm failsafe method for tests (arms with default max cumulative)

Source
arm_failsafe(request : ArmFailSafeRequest, session_fabric_index : UInt8 | Nil, is_pase_session : Bool) : ArmFailSafeResponse

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

Source
attributes

Get all attribute metadata

Source
basic_commissioning_info

Get basic commissioning info (for BasicCommissioningInfo attribute)

Source
close_commissioning_window

Close commissioning window

Source
commands

Get all command metadata

Source
commissioning_complete(session_fabric_index : UInt8 | Nil, is_case_session : Bool) : CommissioningCompleteResponse

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

Source
country_code

Country code (stored for rollback purposes)

Source
country_code=(country_code : String)

Country code (stored for rollback purposes)

Source
country_code_whitelist

Country code whitelist (nil = all countries allowed)

Source
country_code_whitelist=(country_code_whitelist : Array(String) | Nil)

Country code whitelist (nil = all countries allowed)

Source
disarm_fail_safe

Disarm the failsafe

Source
fabric_index
Source
fabric_index=(fabric_index : UInt8 | Nil)
Source
fail_safe_expired?

Check if failsafe is expired

Source
fail_safe_expiry_time

Get failsafe expiry time (when it will expire)

Source
failsafe_armed?

Check if failsafe is currently armed

Source
failsafe_context

Get current failsafe context (for testing/inspection)

Source
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

Source
is_case_session?

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

Source
location_capability

LocationCapability attribute (0x0003) - supported regulatory locations

Source
location_capability=(location_capability : RegulatoryLocationType)

LocationCapability attribute (0x0003) - supported regulatory locations

Source
max_cumulative_failsafe_seconds

BasicCommissioningInfo attribute (0x0001) Contains MaxCumulativeFailsafeSeconds and MaxNetworkCommissioningSeconds

Source
max_cumulative_failsafe_seconds=(max_cumulative_failsafe_seconds : UInt16)

BasicCommissioningInfo attribute (0x0001) Contains MaxCumulativeFailsafeSeconds and MaxNetworkCommissioningSeconds

Source
max_network_commissioning_seconds
Source
max_network_commissioning_seconds=(max_network_commissioning_seconds : UInt16)
Source
name

Get cluster name

Source
on_check_terms_conditions

Callback to check if Terms & Conditions have been accepted

Source
on_check_terms_conditions=(on_check_terms_conditions : Proc(Bool) | Nil)

Callback to check if Terms & Conditions have been accepted

Source
on_clear_pase_sessions

Callback to clear all PASE sessions after successful commissioning

Source
on_clear_pase_sessions=(on_clear_pase_sessions : Proc(Nil) | Nil)

Callback to clear all PASE sessions after successful commissioning

Source
on_failsafe_armed

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

Source
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

Source
on_persist_fabric_table

Callback to persist the fabric table after successful commissioning

Source
on_persist_fabric_table=(on_persist_fabric_table : Proc(Nil) | Nil)

Callback to persist the fabric table after successful commissioning

Source
open_commissioning_window

Open commissioning window (allows PASE sessions)

Source
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

Source
record_added_fabric(fabric_index : UInt8) : Nil

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

Source
regulatory_config

RegulatoryConfig attribute (0x0002) - current regulatory location

Source
regulatory_config=(regulatory_config : RegulatoryLocationType)

RegulatoryConfig attribute (0x0002) - current regulatory location

Source
regulatory_config=(request : SetRegulatoryConfigRequest) : SetRegulatoryConfigResponse

Handle SetRegulatoryConfig command

Sets the regulatory configuration (indoor/outdoor) and country code.

@param request SetRegulatoryConfig request @return SetRegulatoryConfig response with status

Source
restore_regulatory_config(location_type : UInt8, country_code : String) : Nil

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

Source
supports_concurrent_connection=(supports_concurrent_connection : Bool)

SupportsConcurrentConnection attribute (0x0004)

Source
supports_concurrent_connection?

SupportsConcurrentConnection attribute (0x0004)

Source
terms_conditions_accepted?

Check if Terms & Conditions are accepted

Source
terms_conditions_required=(terms_conditions_required : Bool)

Terms & Conditions feature support

Source
terms_conditions_required?

Terms & Conditions feature support

Source
write_attribute(attribute_id : UInt32, value : Bytes) : InteractionModel::Status

Write an attribute value

Source

Nested types