WifiConfig_ForgetAllNetworks Function

Header: #include <applibs/wificonfig.h>

Removes all stored Wi-Fi networks from the device. Disconnects the device from any connected network. This function is not thread safe.

The removal persists across device reboots.

int WifiConfig_ForgetAllNetworks(void);

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.

  • EAGAIN: the Wi-Fi device isn't ready yet.

  • ENETDOWN: the Wi-Fi network interface is unavailable.

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.