WifiConfig_StoreOpenNetwork Function
Header: #include <applibs/wificonfig.h>
Important
This function is obsolete. Use WifiConfig_AddNetwork instead.
Stores an open Wi-Fi network without a key. This function is not thread safe.
This function will fail if an identical network is already stored on the device without a key. See the error section (EEXIST). However, if a stored network includes a key along with the same SSID, this function will succeed and store the network.
int WifiConfig_StoreOpenNetwork(const uint8_t * ssid, size_t ssidLength);
Parameters
ssid
A pointer to an SSID byte array with unspecified character encoding that identifies the Wi-Fi network.ssidLength
The number of bytes in the SSID of the Wi-Fi network.
Errors
Returns -1 if an error is encountered and sets errno
to the error value.
EACCES: the application manifest does not include the WifiConfig capability.
EEXIST: a stored Wi-Fi network that has the same SSID and no key already exists.
EFAULT: the
ssid
is NULL.ERANGE: the
ssidLength
is 0 or greater than WIFICONFIG_SSID_MAX_LENGTH.EAGAIN: the Wi-Fi device isn't ready yet.
ENETDOWN: the Wi-Fi network interface is unavailable.
ENOSPC: there are too many Wi-Fi networks for the configuration to persist; remove one and try again.
Any other errno
may also be specified; such errors aren't deterministic and the same behavior might not be retained through system updates.
Return value
Returns 0 for success, or -1 for failure, in which case errno
is set to the error value.
Application manifest requirements
The application manifest must include the WifiConfig capability.