NetworkInterface - Network interface management and monitoring for KOS devices.

The NetworkInterface model provides comprehensive network interface management capabilities, including WiFi and Ethernet configuration, IP settings, and real-time network state monitoring. This model is essential for applications that need to display network status, configure network connections, or manage network interfaces on KOS devices.

Key Features

  • Network Interface Discovery - Automatically discovers and tracks available network interfaces
  • WiFi Management - Access WiFi connection details, signal strength, and access point information
  • Ethernet Monitoring - Track Ethernet connection status, speed, and duplex settings
  • IP Configuration - Monitor and manage IPv4 settings including addresses, gateways, and DNS
  • Connection State Tracking - Real-time monitoring of network device states and connectivity
  • Hardware Information - Access to MAC addresses, MTU settings, and device capabilities

Network Interface Categories

The model categorizes interfaces for easier management:

  • INTERNAL - Internal system interfaces (loopback, etc.)
  • INTEGRATION - Integration-specific interfaces
  • EXTERNAL - User-facing network interfaces (WiFi, Ethernet)
  • NONE - Uncategorized interfaces

Common Use Cases

  • Network Status Display - Show current connection status and network details in UI
  • Connection Management - Allow users to view and configure network settings
  • Network Diagnostics - Provide detailed network interface information for troubleshooting
  • System Integration - Monitor network connectivity for automated systems
  • Configuration Interfaces - Build network configuration screens with current state

Example: Basic Usage

const networkInterface = NetworkInterface.instance('eth0')
.options({
name: 'eth0',
type: 'ethernet',
configured: true,
category: 'EXTERNAL'
})
.build();

console.log(networkInterface.name); // 'eth0'
console.log(networkInterface.configured); // true

Use Declared Type

See

interface NetworkInterfaceModel {
    id: string;
    name: string;
    type: string;
    nmdevicestate: number;
    hwaddress: string;
    mtu: number;
    configured: boolean;
    category: NetworkInterfaceCategory;
    wifi?: WifiData;
    ethernet?: EthernetData;
    ip4settings?: Ip44Settings;
}

Properties

id: string

Unique identifier for the model instance

name: string

Network interface name (e.g., 'eth0', 'wlan0', 'lo')

type: string

Interface type identifier (e.g., 'ethernet', 'wifi', 'loopback')

nmdevicestate: number

NetworkManager device state code indicating connection status

hwaddress: string

Hardware MAC address of the network interface

mtu: number

Maximum Transmission Unit size for the interface

configured: boolean

Whether the interface is currently configured and active

Interface categorization for organizational purposes

wifi?: WifiData

WiFi-specific connection data including SSID, signal strength, and security

ethernet?: EthernetData

Ethernet-specific connection data including carrier status, speed, and duplex

ip4settings?: Ip44Settings

IPv4 network settings including address, gateway, and DNS configuration