network
The sos.management.network
API groups together methods for networking.
Use sos.management.supports('NETWORK_INFO')
to check if the device supports managing the network setup.
Methods
disableInterface()
The disableInterface()
disables a network interface.
Don't use this method to disable Wi-Fi. Use Wi-Fi API to enable/disable Wi-Fi.
disableInterface(interfaceName: string): Promise<void>;
Params
Name | Type | Description |
---|---|---|
interfaceName | string | 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.
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
Name | Type | Description |
---|---|---|
interfaceName | string | 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.
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
Name | Type | Description |
---|---|---|
interfaceName | string | The interface name which can be retrieved from the list of interfaces returned by listInterfaces() |
options | INetworkOptions | The network configuration options. |
getActiveInfo()
This method was deprecated. Use sos.management.network.listInterfaces()
instead.
getActiveInfo(): Promise<INetworkInfo>;
setDHCP(networkInterface)
This method was deprecated. Use sos.management.network.setDHCP(interfaceName)
instead.
setDHCP(networkInterface: NetworkInterface): Promise<void>;
setManual(options)
This method was deprecated. Use sos.management.network.setManual(interfaceName, options)
instead.
setManual(options: INetworkOptionsLegacy): Promise<void>;