Skip to main content

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

NameTypeRequiredDescription
interfaceNamestring
Yes
The 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

NameTypeRequiredDescription
interfaceNamestring
Yes
The 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

NameTypeRequiredDescription
interfaceNamestring
Yes
The interface name which can be retrieved from the list of interfaces returned by listInterfaces()
optionsINetworkOptions
Yes
The 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>;