class

Matter::Cluster::NetworkCommissioningCluster

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

Network Commissioning Cluster (0x0031)

This cluster is used to configure network interfaces on Matter devices. It supports WiFi, Thread, and Ethernet network management.

Matter Specification: Core 1.4 § 11.8 - Network Commissioning Cluster

Commands:

  • ScanNetworks (0x00): Scan for available networks
  • AddOrUpdateWiFiNetwork (0x02): Add or update WiFi network configuration
  • AddOrUpdateThreadNetwork (0x03): Add or update Thread network configuration
  • RemoveNetwork (0x04): Remove a network from the Networks list
  • ConnectNetwork (0x06): Connect to a configured network
  • ReorderNetwork (0x08): Reorder network priority

Attributes:

  • MaxNetworks (0x00): Maximum number of networks
  • Networks (0x01): List of configured networks
  • ScanMaxTimeSeconds (0x02): Maximum scan time
  • ConnectMaxTimeSeconds (0x03): Maximum connect time
  • InterfaceEnabled (0x04): Network interface enabled status
  • LastNetworkingStatus (0x05): Status of last operation
  • LastNetworkID (0x06): Network ID of last operation
  • LastConnectErrorValue (0x07): Error value from last connect

Constants

ATTR_ATTRIBUTE_LIST = 65531_u32
ATTR_CLUSTER_REVISION = 65533_u32

Global attribute IDs

ATTR_CONNECT_MAX_TIME_SECONDS = 3_u32
ATTR_FEATURE_MAP = 65532_u32
ATTR_INTERFACE_ENABLED = 4_u32
ATTR_LAST_CONNECT_ERROR_VALUE = 7_u32
ATTR_LAST_NETWORK_ID = 6_u32
ATTR_LAST_NETWORKING_STATUS = 5_u32
ATTR_MAX_NETWORKS = 0_u32

Attributes

ATTR_NETWORKS = 1_u32
ATTR_SCAN_MAX_TIME_SECONDS = 2_u32
ATTR_SUPPORTED_THREAD_FEATURES = 9_u32
ATTR_SUPPORTED_WIFI_BANDS = 8_u32
CLUSTER_ID = 49_u32
CMD_ADD_OR_UPDATE_THREAD_NETWORK = 3_u32
CMD_ADD_OR_UPDATE_WIFI_NETWORK = 2_u32
CMD_CONNECT_NETWORK = 6_u32
CMD_CONNECT_NETWORK_RESPONSE = 7_u32
CMD_NETWORK_CONFIG_RESPONSE = 5_u32
CMD_REMOVE_NETWORK = 4_u32
CMD_REORDER_NETWORK = 8_u32
CMD_SCAN_NETWORKS = 0_u32

Commands

CMD_SCAN_NETWORKS_RESPONSE = 1_u32
Log = ::Log.for("matter.cluster.network_commissioning")

Constructors

new(endpoint_id : DataType::EndpointNumber = DataType::EndpointNumber.new(0_u16), network_type : NetworkType = NetworkType::WiFi, max_networks : UInt8 = 1_u8, feature_map : Feature = Feature::None, features : Feature | Nil = nil, scan_max_time_seconds : UInt8 = 30_u8, connect_max_time_seconds : UInt8 = 60_u8, backend : Network::Backend | Nil = nil)
Source
new(endpoint_id : DataType::EndpointNumber, network_type : NetworkType, feature : Feature)

Overload for tests that pass (endpoint_id, network_type, feature)

Source

Class methods

cluster_id

Network Commissioning Cluster (0x0031)

This cluster is used to configure network interfaces on Matter devices. It supports WiFi, Thread, and Ethernet network management.

Matter Specification: Core 1.4 § 11.8 - Network Commissioning Cluster

Commands:

  • ScanNetworks (0x00): Scan for available networks
  • AddOrUpdateWiFiNetwork (0x02): Add or update WiFi network configuration
  • AddOrUpdateThreadNetwork (0x03): Add or update Thread network configuration
  • RemoveNetwork (0x04): Remove a network from the Networks list
  • ConnectNetwork (0x06): Connect to a configured network
  • ReorderNetwork (0x08): Reorder network priority

Attributes:

  • MaxNetworks (0x00): Maximum number of networks
  • Networks (0x01): List of configured networks
  • ScanMaxTimeSeconds (0x02): Maximum scan time
  • ConnectMaxTimeSeconds (0x03): Maximum connect time
  • InterfaceEnabled (0x04): Network interface enabled status
  • LastNetworkingStatus (0x05): Status of last operation
  • LastNetworkID (0x06): Network ID of last operation
  • LastConnectErrorValue (0x07): Error value from last connect
Source

Instance methods

attributes

Get all attribute metadata

Source
backend

Platform backend for network operations (required)

Source
backend=(backend : Network::Backend | Nil)

Platform backend for network operations (required)

Source
commands

Get all command metadata

Source
connect_max_time_seconds
Source
connect_max_time_seconds=(connect_max_time_seconds : UInt8)
Source
connected_network

Helper: Get current connected network

Source
feature_map
Source
feature_map=(feature_map : Feature)
Source
handle_add_or_update_thread_network(cmd : AddOrUpdateThreadNetworkRequest, failsafe_armed : Bool) : NetworkConfigResponse

AddOrUpdateThreadNetwork command (0x03)

Source
handle_add_or_update_wifi_network(cmd : AddOrUpdateWiFiNetworkRequest, failsafe_armed : Bool) : NetworkConfigResponse

AddOrUpdateWiFiNetwork command (0x02)

Source
handle_connect_network(cmd : ConnectNetworkRequest, failsafe_armed : Bool) : ConnectNetworkResponse

ConnectNetwork command (0x06)

Source
handle_remove_network(cmd : RemoveNetworkRequest, failsafe_armed : Bool) : NetworkConfigResponse

RemoveNetwork command (0x04)

Source
handle_reorder_network(cmd : ReorderNetworkRequest, failsafe_armed : Bool) : NetworkConfigResponse

ReorderNetwork command (0x08)

Source
handle_scan_networks(cmd : ScanNetworksRequest, failsafe_armed : Bool) : ScanNetworksResponse

ScanNetworks command (0x00)

Source
has_network?(network_id : Bytes) : Bool

Helper: Check if network exists

Source
interface_enabled=(interface_enabled : Bool)
Source
interface_enabled?
Source
last_connect_error_value
Source
last_connect_error_value=(last_connect_error_value : Int32 | Nil)
Source
last_network_id
Source
last_network_id=(last_network_id : Bytes | Nil)
Source
last_networking_status
Source
last_networking_status=(last_networking_status : NetworkCommissioningStatus | Nil)
Source
max_networks
Source
max_networks=(max_networks : UInt8)
Source
name

Get cluster name

Source
network_type

Instance variables

Source
network_type=(network_type : NetworkType)

Instance variables

Source
networks
Source
networks=(networks : Array(NetworkInfo))
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
restore_network_state(state : Hash(String, String)) : Nil

Restore network state from snapshot (used during failsafe rollback)

This method restores the network configuration to a previously captured state. It's called during failsafe rollback to undo any network configuration changes made during a failed commissioning session.

@param state Snapshot of network state (key-value pairs)

Source
scan_max_time_seconds
Source
scan_max_time_seconds=(scan_max_time_seconds : UInt8)
Source
supported_thread_features
Source
supported_thread_features=(supported_thread_features : ThreadCapabilitiesBitmap | Nil)
Source
supported_wifi_bands
Source
supported_wifi_bands=(supported_wifi_bands : Array(WiFiBandEnum) | Nil)
Source
thread_credentials

Thread-specific

Source
thread_credentials=(thread_credentials : Hash(Bytes, Bytes))

Thread-specific

Source
thread_version
Source
thread_version=(thread_version : UInt16 | Nil)
Source
wifi_credentials

WiFi-specific

Source
wifi_credentials=(wifi_credentials : Hash(Bytes, Bytes))

WiFi-specific

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

Write an attribute value

Source

Nested types