ConnectToWifiNetwork function connects to the given Wifi network.
Note: Please read the platform restrictions described here first.
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
bool: ConnectToWifiNetwork(string networkName[, string networkPassword = "", string networkInterface = "", int timeoutMilliseconds = 5000, bool oldNetworkManager = false])
var result = ConnectToWifiNetwork("GP Network SSID", "goprohero", "wlan0", "myrootpassword"); // returns true on success, or false if the command times out.