Skip to main content
Version: 8.0.3

network

The sos.management.network API groups together methods for networking.

info

Use sos.management.supports('NETWORK_INFO') to check if the device supports managing the network setup.

Methods

disableInterface()

The disableInterface() disables a network interface.

warning

Don't use this method to disable Wi-Fi. Use Wi-Fi API to enable/disable Wi-Fi.

disableInterface(interfaceName: string): Promise<void>;

Params

NameTypeDescription
interfaceNamestringThe interface name which can be retrieved from the list of interfaces returned by listInterfaces()

listInterfaces()

The listInterface() method returns list of all network interfaces, and their information like MAC address, IP address, etc. Wifi connection strength is described as percentage in range from 0 to 100, linearly converted from dBm -90 to -30 respectively based on platform.

listInterfaces(): Promise<INetworkInterface[]>;

setDHCP(interfaceName)

The setDHCP() method configures a network interface to use DHCP.

warning

Wi-Fi interface can be configured with this method but it has to be first enabled via the Wi-Fi API.

setDHCP(interfaceName: string): Promise<void>;

Params

NameTypeDescription
interfaceNamestringThe interface name which can be retrieved from the list of interfaces returned by listInterfaces()

setManual(interfaceName, options)

The setManual() method manually configures a network interface.

warning

Wi-Fi interface can be configured with this method but it has to be first enabled via the Wi-Fi API.

setManual(interfaceName: string, options: INetworkOptions): Promise<void>;

Params

NameTypeDescription
interfaceNamestringThe interface name which can be retrieved from the list of interfaces returned by listInterfaces()
optionsINetworkOptionsThe network configuration options.

getActiveInfo()

Deprecated

This method was deprecated. Use sos.management.network.listInterfaces() instead.

getActiveInfo(): Promise<INetworkInfo>;

setDHCP(networkInterface)

Deprecated

This method was deprecated. Use sos.management.network.setDHCP(interfaceName) instead.

setDHCP(networkInterface: NetworkInterface): Promise<void>;

setManual(options)

Deprecated

This method was deprecated. Use sos.management.network.setManual(interfaceName, options) instead.

setManual(options: INetworkOptionsLegacy): Promise<void>;