WifiConfig_ForgetNetwork Function

Header: #include <applibs/wificonfig.h>

Important

This function is obsolete. Use WifiConfig_ForgetNetworkById instead.

Removes a Wi-Fi network from the device. Disconnects the device from the network if it's currently connected. This function is not thread safe.

int WifiConfig_ForgetNetwork(const WifiConfig_StoredNetwork * storedNetwork);

Parameters

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.

  • EFAULT: the ssid parameter is NULL.

  • ENOENT: the storedNetwork parameter doesn't match any of the stored networks.

  • EINVAL: the storedNetwork parameter or its struct version is invalid.

  • 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.