User Tools

Site Tools


connecttowifinetwork

ConnectToWifiNetwork (since 1.0.1)

The ConnectToWifiNetwork function connects to the given Wifi network.

Note: Please read the platform restrictions described here first.

Parameters

  • networkName: The network to connect to. On Windows and Linux this is the profile name. On all other platforms this is the Wifi SSID.
  • networkPassword: The network password. This field is required on OS X.
  • networkInterface: The network interface which is used to connect to the network. This argument is only used on OS X. A common interface name is “en0”.
  • timeoutMilliseconds: The time in milliseconds until connecting to the given network is canceled.
  • oldNetworkManager (Linux only): If a network manager older than 1.0 (e.g. in Ubuntu older than 16.04) is used then this variable must be set to true. The default value is false. You can find out the network manager version by running the command nmcli -v.

Syntax

bool: ConnectToWifiNetwork(string networkName[, string networkPassword = "", string networkInterface = "", int timeoutMilliseconds = 5000, bool oldNetworkManager = false])

Examples

var result = ConnectToWifiNetwork("GP Network SSID", "goprohero", "wlan0", "myrootpassword");
// returns true on success, or false if the command times out.
connecttowifinetwork.txt · Last modified: 2016/09/20 09:29 by act