abstract class Matter::Network::Backend

Overview

Abstract base class for platform-specific network operations

Implementations of this class provide the actual platform-specific code for scanning, connecting, and managing WiFi and Thread networks.

The NetworkCommissioningCluster delegates to this backend for all actual network operations.

Defined in:

matter/network/backend.cr

Instance Method Summary

Instance Method Detail

abstract def add_thread_network(credentials : ThreadCredentials) : Bool #

Add or update a Thread network configuration

The ThreadCredentials contain the operational dataset and parsed key parameters like Extended PAN ID, network name, etc.

@param credentials Parsed Thread network credentials @return True if successful


[View source]
abstract def add_wifi_network(network_info : WiFiNetworkInfo) : Bool #

Add or update a WiFi network configuration

The WiFiNetworkInfo contains the SSID and parsed credentials with inferred security type, making it easy to configure the network.

@param network_info Parsed WiFi network information @return True if successful


[View source]
abstract def connect_network(network_id : Bytes) : Tuple(Bool, Int32 | Nil) #

Connect to a configured network

@param network_id Network identifier (SSID for WiFi, XPAN for Thread) @return Tuple of (success, error_value) error_value is platform-specific error code (e.g., 802.11 status code for WiFi)


[View source]
abstract def disconnect_network : Nil #

Disconnect from current network


[View source]
abstract def is_connected?(network_id : Bytes) : Bool #

Check if a network is currently connected

@param network_id Network identifier (SSID for WiFi, XPAN for Thread) @return True if connected


[View source]
abstract def remove_network(network_id : Bytes) : Bool #

Remove a network configuration

@param network_id Network identifier (SSID for WiFi, XPAN for Thread) @return True if successful


[View source]

Scan for available Thread networks

@return Array of discovered Thread networks


[View source]
abstract def scan_wifi(ssid : String | Nil) : Array(Cluster::NetworkCommissioningCluster::WiFiInterfaceScanResult) #

Scan for available WiFi networks

@param ssid Optional SSID string for directed scan (nil for broadcast scan) @return Array of discovered WiFi networks


[View source]