abstract class
Matter::Network::Backend
- Matter::Network::Backend
- Reference
- Object
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.crInstance Method Summary
-
#add_thread_network(credentials : ThreadCredentials) : Bool
Add or update a Thread network configuration
-
#add_wifi_network(network_info : WiFiNetworkInfo) : Bool
Add or update a WiFi network configuration
-
#connect_network(network_id : Bytes) : Tuple(Bool, Int32 | Nil)
Connect to a configured network
-
#disconnect_network : Nil
Disconnect from current network
-
#is_connected?(network_id : Bytes) : Bool
Check if a network is currently connected
-
#remove_network(network_id : Bytes) : Bool
Remove a network configuration
-
#scan_thread : Array(Cluster::NetworkCommissioningCluster::ThreadInterfaceScanResult)
Scan for available Thread networks
-
#scan_wifi(ssid : String | Nil) : Array(Cluster::NetworkCommissioningCluster::WiFiInterfaceScanResult)
Scan for available WiFi networks
Instance Method Detail
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
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
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)
Check if a network is currently connected
@param network_id Network identifier (SSID for WiFi, XPAN for Thread) @return True if connected
Remove a network configuration
@param network_id Network identifier (SSID for WiFi, XPAN for Thread) @return True if successful
Scan for available Thread networks
@return Array of discovered Thread networks
Scan for available WiFi networks
@param ssid Optional SSID string for directed scan (nil for broadcast scan) @return Array of discovered WiFi networks