Leaving Wireless Access Point
When an application needs to leave a wireless access point, it can do so by calling the NetIF_WiFi_Leave()
API function with the necessary parameters.
A call to NetIF_WiFi_Leave()
is shown below.
Listing - Call to NetIF_WiFi_Leave()
NET_ERR err; ap_ctn = NetIF_WiFi_Leave(if_nbr, (1) &err); (2)
NetIF_WiFi_Leave()
requires two arguments. The first function argument is the interface number. The interface number is acquired upon successful addition of the interface and upon the successful start of the interface.- The last argument is a pointer to a
NET_ERR
to contain the return error code. The return error variable will contain the valueNET_IF_WIFI_ERR_NONE
if the leave process has been completed successfully.
There are very few things that could cause a network interface to leave improperly. You should always inspect the return error code and take the appropriate action if an error occurs. Once the error is resolved, the application may again attempt to call NetIF_WiFi_Leave()
.